-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
104 changed files
with
2,600 additions
and
242 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
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,28 @@ | ||
name: Build GO-next PR | ||
run-name: Build GO-next for ${{ github.event.number }} - ${{ github.event.pull_request.title }} | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'apps/gi-backend/**' | ||
- 'apps/gi-backend-e2e/**' | ||
- 'apps/gi-frontend-next-e2e/**' | ||
- 'apps/gi-frontend-next-e2e/**' | ||
- 'apps/sr-frontend/**' | ||
- 'apps/sr-frontend-e2e/**' | ||
- 'libs/gi/frontend-gql/**' | ||
- 'libs/gi/prisma-schema/**' | ||
- 'libs/gi/ui-next/**' | ||
- 'libs/sr/**' | ||
types: [opened, reopened, synchronize, labeled] | ||
|
||
jobs: | ||
call-build-gi-frontend: | ||
uses: ./.github/workflows/build-frontend.yml | ||
with: | ||
frontend_name: 'gi-frontend' | ||
deployment_name: ${{ github.event.number }} | ||
show_dev_components: ${{ contains(github.event.pull_request.labels.*.name, 'showDevComponents') }} |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'use client' | ||
import { Button, Container, Grid, Skeleton, Typography } from '@mui/material' | ||
import { Suspense, useEffect, useState } from 'react' | ||
import { useSupabase } from '../../utils/supabase/client' | ||
import { TeamCard } from './TeamCard' | ||
import type { Teams } from './getTeams' | ||
|
||
const columns = { xs: 1, sm: 2, md: 3, lg: 3, xl: 4 } | ||
// const numToShowMap = { xs: 5, sm: 6, md: 12, lg: 12, xl: 12 } | ||
|
||
export default function Content({ | ||
teams: serverTeams, | ||
accountId, | ||
}: { | ||
teams: Teams | ||
accountId: string | ||
}) { | ||
const supabase = useSupabase() | ||
const [teams, setTeams] = useState(serverTeams) | ||
const addTeam = async () => { | ||
try { | ||
const { error } = await supabase.from('teams').insert({ | ||
account_id: accountId, | ||
} as any) | ||
if (error) console.error(error) | ||
} catch (error) { | ||
console.error(error) | ||
} | ||
} | ||
useEffect(() => { | ||
const channel = supabase | ||
.channel('team updates') | ||
.on( | ||
'postgres_changes', | ||
{ | ||
event: '*', | ||
schema: 'public', | ||
table: 'teams', | ||
filter: `account_id=eq.${accountId}`, | ||
}, | ||
(payload) => { | ||
if (payload.new) setTeams((teams) => [...teams, payload.new] as Teams) | ||
} | ||
) | ||
.subscribe() | ||
|
||
return () => { | ||
supabase.removeChannel(channel) | ||
} | ||
}) | ||
return ( | ||
<Container> | ||
<Button onClick={addTeam}> Add Team</Button> | ||
<Typography>Teams</Typography> | ||
|
||
<Suspense | ||
fallback={ | ||
<Skeleton | ||
variant="rectangular" | ||
sx={{ width: '100%', height: '100%', minHeight: 5000 }} | ||
/> | ||
} | ||
> | ||
<Grid container spacing={1} columns={columns}> | ||
{teams.map((team) => ( | ||
<Grid item key={team.id} xs={1}> | ||
<TeamCard team={team} /> | ||
</Grid> | ||
))} | ||
</Grid> | ||
</Suspense> | ||
</Container> | ||
) | ||
} |
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,16 @@ | ||
import { CardThemed } from '@genshin-optimizer/common/ui' | ||
import { CardActionArea, CardContent, Typography } from '@mui/material' | ||
import Link from 'next/link' | ||
import type { Team } from './getTeams' | ||
export function TeamCard({ team }: { team: Team }) { | ||
return ( | ||
<CardThemed> | ||
<CardActionArea component={Link} href={`/teams/${team.id}`}> | ||
<CardContent> | ||
<Typography>{team.name ?? 'Team Name'}</Typography> | ||
<Typography>{team.description ?? 'Team Description'}</Typography> | ||
</CardContent> | ||
</CardActionArea> | ||
</CardThemed> | ||
) | ||
} |
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 @@ | ||
//create a context for calc object | ||
import type { Calculator } from '@genshin-optimizer/gi/formula' | ||
import { createContext } from 'react' | ||
|
||
export const CalcContext = createContext<Calculator | null>(null) |
Oops, something went wrong.