Skip to content

Commit 5558c26

Browse files
committed
feat: add banner for logging in
1 parent 96b21f3 commit 5558c26

File tree

3 files changed

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

3 files changed

+12
-4
lines changed

src/components/sections/learning-modules/InteractiveModule/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { IRootState } from "@/store";
2020
* @interface InteractiveModuleMultiSelector
2121
* @typedef {InteractiveModuleMultiSelector}
2222
*/
23-
interface InteractiveModuleMultiSelector {
23+
export interface InteractiveModuleMultiSelector {
2424
isLoggedIn: boolean;
2525
course: Course | null;
2626
}

src/components/ui/Hint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type HintProps = {
66
};
77

88
function Hint({ children, className }: HintProps): ReactElement {
9-
return <div className={`bg-yellow-50 text-yellow-900 py-5 px-8 border border-solid border-yellow-100 text-base hint-container ${className}`}>{children}</div>;
9+
return <div className={`bg-yellow-50 text-yellow-900 py-5 px-8 text-base hint-container ${className}`}>{children}</div>;
1010
}
1111

1212
export default Hint;

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

Lines changed: 10 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,13 @@ export default function ChallengePage(props: {
131132
</>
132133
)}
133134
</div>
135+
) : (
136+
<Hint className="mt-6 flex flex-col md:flex-row">
137+
<p>To be able to submit</p>&nbsp;
138+
<Link className="underline" href="/login">
139+
Login
140+
</Link>
141+
</Hint>
134142
)}
135143
</div>
136144
</Wrapper>

0 commit comments

Comments
 (0)