-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ML challenge page routing (#728)
#705 - Adds routing for the ML challenge page at `/competition` (pending confirmation from @junxini) - Sets up skeleton page for ML challenge page with footer and header layout - Adds feature flag + redirect to 404 page when flag is disabled ## Demo <img width="1728" alt="image" src="https://github.com/chanzuckerberg/cryoet-data-portal/assets/2176050/563751f8-3edd-4c9f-b029-49ff03fd8aac"> --------- Co-authored-by: Kira Evans <[email protected]>
- Loading branch information
1 parent
5c29681
commit be5e86c
Showing
6 changed files
with
77 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
frontend/packages/data-portal/app/components/MLChallenge/MLChallenge.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Demo } from 'app/components/Demo' | ||
|
||
export function MLChallenge() { | ||
return <Demo>ML Challenge</Demo> | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/packages/data-portal/app/components/MLChallenge/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './MLChallenge' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { LoaderFunctionArgs, redirect } from '@remix-run/server-runtime' | ||
|
||
import { MLChallenge } from 'app/components/MLChallenge' | ||
import { getFeatureFlag } from 'app/utils/featureFlags' | ||
|
||
export function loader({ request }: LoaderFunctionArgs) { | ||
const url = new URL(request.url) | ||
const showMlChallenge = getFeatureFlag({ | ||
env: process.env.ENV, | ||
key: 'mlChallenge', | ||
params: url.searchParams, | ||
}) | ||
|
||
if (!showMlChallenge) { | ||
return redirect('/404') | ||
} | ||
|
||
return null | ||
} | ||
|
||
export default function CompetitionPage() { | ||
return <MLChallenge /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters