-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from DAOmasons/Aug6
Aug6
- Loading branch information
Showing
13 changed files
with
176 additions
and
136 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
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,72 @@ | ||
import { Box, Divider, Group, Skeleton, Text } from '@mantine/core'; | ||
import { ResolvedUpdate } from '../resolvers/updates'; | ||
import { Display } from './Display'; | ||
import { PlayerAvatar } from './PlayerAvatar'; | ||
import { secondsToShortRelativeTime } from '../utils/time'; | ||
import { Player } from '../types/ui'; | ||
import { RTDisplay } from './RTDisplay'; | ||
|
||
export const UpdatesPanel = ({ | ||
updates, | ||
name, | ||
isLoading, | ||
error, | ||
imgUrl, | ||
playerType, | ||
}: { | ||
playerType: Player; | ||
updates?: ResolvedUpdate[]; | ||
imgUrl?: string; | ||
name: string; | ||
isLoading: boolean; | ||
error: Error | null; | ||
}) => { | ||
if (isLoading) { | ||
return ( | ||
<Box> | ||
<Box mt="200" /> | ||
<Skeleton h={1} mb={200} /> | ||
<Skeleton h={1} mb={200} /> | ||
</Box> | ||
); | ||
} | ||
|
||
if (error) { | ||
return <Display title="Error" description={error.message} />; | ||
} | ||
|
||
if (!updates || updates?.length === 0) { | ||
return ( | ||
<Display | ||
title="Just Getting Started" | ||
description={`${name} hasn't posted any updates yet.`} | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<Box> | ||
{updates.map((update) => ( | ||
<Box pb="lg" key={update.id}> | ||
<Group mb="sm" gap={8}> | ||
<PlayerAvatar | ||
imgUrl={imgUrl || ''} | ||
name={name} | ||
playerType={playerType} | ||
/> | ||
<Text size="sm" opacity={0.8}> | ||
· | ||
</Text> | ||
<Text size="sm" opacity={0.8}> | ||
{secondsToShortRelativeTime(update.timestamp)} | ||
</Text> | ||
</Group> | ||
<Box mb="lg" pl={50}> | ||
<RTDisplay content={update.content} /> | ||
</Box> | ||
<Divider mb="lg" /> | ||
</Box> | ||
))} | ||
</Box> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
query shipPageQuery($id: String!) { | ||
GrantShip(where: { id: { _eq: $id } }) { | ||
...BaseShipData | ||
hatId | ||
} | ||
} |
Oops, something went wrong.