-
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.
Introduce colours and categories on the Shifts page
- Loading branch information
Showing
7 changed files
with
126 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2024 Peter Beverloo & AnimeCon. All rights reserved. | ||
// Use of this source code is governed by a MIT license that can be found in the LICENSE file. | ||
|
||
import Box from '@mui/material/Box'; | ||
import Tooltip from '@mui/material/Tooltip'; | ||
|
||
/** | ||
* Props accepted by the <Square> component. | ||
*/ | ||
export interface SquareProps { | ||
/** | ||
* Colour, in an HTML-renderable format, to render the square in. | ||
*/ | ||
colour: string; | ||
|
||
/** | ||
* Tooltip title to show when hovering over the square. | ||
*/ | ||
title: string; | ||
} | ||
|
||
/** | ||
* The <Square> component draws a rectangular square with a particular colour, featuring a tooltip | ||
* that explains what the colour is indicating. | ||
*/ | ||
export function Square(props: SquareProps) { | ||
return ( | ||
<Tooltip title={props.title}> | ||
<Box sx={{ | ||
backgroundColor: props.colour, | ||
border: '1px solid transparent', | ||
borderColor: 'divider', | ||
borderRadius: 1, | ||
height: '21px', | ||
width: '21px', | ||
}} /> | ||
</Tooltip> | ||
); | ||
} |
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