Skip to content

Commit 87a42b2

Browse files
authored
Merge pull request #960 from dacadeorg/feat/add-banner
fix: add banner for logging on the challenge page
2 parents aa8a5f5 + 4757c05 commit 87a42b2

File tree

1 file changed

+12
-2
lines changed
  • src/pages/communities/[slug]/challenges/[challenge_id]

1 file changed

+12
-2
lines changed

src/pages/communities/[slug]/challenges/[challenge_id]/index.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import { getTeamByChallenge, getUserInvitesByChallenge } from "@/store/services/
3232
import { fetchChallenge, fetchChallengeAuthenticated } from "@/store/services/communities/challenges";
3333
import Loader from "@/components/ui/Loader";
3434
import { NotFoundError } from "@/utilities/errors/NotFoundError";
35+
import Hint from "@/components/ui/Hint";
36+
import Link from "next/link";
3537

3638
/**
3739
* interface for ChallengePage multiSelector
@@ -75,7 +77,6 @@ export default function ChallengePage(props: {
7577
isAuthenticated: (state: IRootState) => authCheck(state),
7678
isSubmissionLoading: (state: IRootState) => state.challenges.loading,
7779
});
78-
7980
const title = useMemo(() => getMetadataTitle(t("communities.challenge.title"), challenge?.name || ""), [challenge?.name, t]);
8081

8182
const navigation = useNavigation();
@@ -109,7 +110,7 @@ export default function ChallengePage(props: {
109110
<RatingRubric ratingCriteria={challenge?.ratingCriteria} selected={[]} />
110111
<BestSubmissions />
111112

112-
{isAuthenticated && (
113+
{isAuthenticated ? (
113114
<div>
114115
{isSubmissionLoading ? (
115116
<div className="h-24 sm:h-48 grid place-items-center">
@@ -131,6 +132,15 @@ export default function ChallengePage(props: {
131132
</>
132133
)}
133134
</div>
135+
) : (
136+
<div>
137+
<Hint className="mt-6 flex flex-col md:flex-row">
138+
<p>To be able to submit</p>&nbsp;
139+
<Link className="underline" href="/login">
140+
Login.
141+
</Link>
142+
</Hint>
143+
</div>
134144
)}
135145
</div>
136146
</Wrapper>

0 commit comments

Comments
 (0)