diff --git a/src/pages/dashboard.jsx b/src/pages/dashboard.jsx index e3f489b5..bd79e0bd 100644 --- a/src/pages/dashboard.jsx +++ b/src/pages/dashboard.jsx @@ -32,7 +32,7 @@ export default function Dashboard() { const [loading, setLoading] = useState(false); const [showOnboarding, setShowOnboarding] = useState(false); const [showUpgradeModal, setShowUpgradeModal] = useState(false); - + const [role, setRole] = useState(false); const exampleObjectives = [ { completed: false, @@ -114,9 +114,21 @@ export default function Dashboard() { } }; + const fetchAccountDetails = async() => { + request(`${process.env.NEXT_PUBLIC_API_URL}/account`, 'GET', null) + .then((data) => { + + setRole(data.role); + }) + .catch((err) => { + console.log(err); + }); + } + fetchRecommendedChallenges(); fetchPopularChallenges(); + fetchAccountDetails(); request(`${process.env.NEXT_PUBLIC_API_URL}/activityFeed/`, 'GET', null).then(response => { console.log(response) setActivities(response.activityFeed); @@ -274,10 +286,13 @@ export default function Dashboard() { - + +
-
- - No worries - we'll get you back to your account in no time. -
-No worries - we'll get you back to your account in no time.
+
+
+ {user && points && (
+
+ Points: {points}
+
+ )}
+
{' '}
{(user && user.location) || (