Skip to content

Commit

Permalink
aesthetic changes
Browse files Browse the repository at this point in the history
fixed back arrow on match-editor
added match-editor link on match pages
  • Loading branch information
varCepheid committed Dec 14, 2023
1 parent 4793467 commit 83c8aa6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/components/match-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const matchTitleStyle = css`
grid-row: span 2;
white-space: nowrap;
margin: 0.3rem 0.6rem;
display: flex;
align-items: center;
& > * {
margin: 0.3rem 0;
}
Expand Down Expand Up @@ -85,6 +88,11 @@ const blueStyle = css`
background-color: var(--alliance-blue);
`

const pencilIconStyle = css`
width: 1rem;
aspect-ratio: 1;
`

export const MatchDetailsCard = memo(
({ match, eventKey, link, class: className, isAdmin }: MatchCardProps) => {
const matchName = formatMatchKey(match.key)
Expand Down Expand Up @@ -117,6 +125,7 @@ export const MatchDetailsCard = memo(
<IconButton
icon={mdiPencil}
href={`/events/${eventKey}/matches/${match.key}/editor`}
class={pencilIconStyle}
/>
)}
</div>
Expand Down
11 changes: 10 additions & 1 deletion src/routes/event-match.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
ConnectionType,
useNetworkConnection,
} from '@/utils/use-network-connection'
import { useJWT } from '@/jwt'

interface Props {
eventKey: string
Expand Down Expand Up @@ -160,6 +161,10 @@ const EventMatch = ({ eventKey, matchKey }: Props) => {
}
}, [match, isOnline])

const { jwt } = useJWT()
const isAdmin =
jwt && (jwt.peregrineRoles.isAdmin || jwt.peregrineRoles.isSuperAdmin)

return (
// page setup
<Page
Expand Down Expand Up @@ -211,7 +216,11 @@ const EventMatch = ({ eventKey, matchKey }: Props) => {
</div>
</Card>
)}
<MatchDetailsCard match={match} eventKey={eventKey} />
<MatchDetailsCard
match={match}
eventKey={eventKey}
isAdmin={isAdmin || false}
/>
{reports && reports.length > 0 ? (
<MatchReports
match={match}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/match-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const MatchEditor = ({
eventKey: string
matchKey: string
}) => (
<Page name={'Edit Match'} back={`/events/${eventKey}/events/${matchKey}`}>
<Page name={'Edit Match'} back={`/events/${eventKey}/matches/${matchKey}`}>
<Card class={cardStyle}>
<ErrorBoundary>
<EditorForm eventKey={eventKey} matchKey={matchKey} />
Expand Down

0 comments on commit 83c8aa6

Please sign in to comment.