-
Notifications
You must be signed in to change notification settings - Fork 6
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 #400 from systemli/switch-ui-to-mui
💄 Switch UI Library from Semantic UI to MUI
- Loading branch information
Showing
92 changed files
with
5,069 additions
and
2,740 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
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,13 @@ | ||
import React from 'react' | ||
|
||
export function MapContainer({ children }: { children: React.ReactNode }) { | ||
return <>{children}</> | ||
} | ||
|
||
export function Marker({ children }: { children: React.ReactNode }) { | ||
return <>{children}</> | ||
} | ||
|
||
export function TileLayer({ children }: { children: React.ReactNode }) { | ||
return <>{children}</> | ||
} |
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,15 @@ | ||
import { CircularProgress, Stack, Typography } from '@mui/material' | ||
import React, { FC } from 'react' | ||
|
||
const Loader: FC = () => { | ||
return ( | ||
<Stack alignItems="center" justifyContent="center" sx={{ m: 10 }}> | ||
<CircularProgress size="3rem" /> | ||
<Typography component="span" sx={{ pt: 2 }} variant="h5"> | ||
Loading | ||
</Typography> | ||
</Stack> | ||
) | ||
} | ||
|
||
export default Loader |
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,20 @@ | ||
import React, { FC } from 'react' | ||
import { Box, Typography } from '@mui/material' | ||
|
||
interface Props { | ||
title: string | ||
children: React.ReactNode | ||
} | ||
|
||
const NamedListItem: FC<Props> = ({ title, children }) => { | ||
return ( | ||
<Box sx={{ mb: 1 }}> | ||
<Typography color="GrayText" component="span" variant="body2"> | ||
{title} | ||
</Typography> | ||
{children} | ||
</Box> | ||
) | ||
} | ||
|
||
export default NamedListItem |
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 { Box } from '@mui/material' | ||
import React, { FC } from 'react' | ||
|
||
interface Props { | ||
children?: React.ReactNode | ||
index: number | ||
value: number | ||
} | ||
|
||
const TabPanel: FC<Props> = ({ children, index, value }) => { | ||
return ( | ||
<div | ||
aria-labelledby={`simple-tab-${index}`} | ||
hidden={value !== index} | ||
id={`simple-tabpanel-${index}`} | ||
role="tabpanel" | ||
> | ||
{value === index && <Box sx={{ py: 2 }}>{children}</Box>} | ||
</div> | ||
) | ||
} | ||
|
||
export default TabPanel |
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,35 @@ | ||
import React, { FC } from 'react' | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { IconButton, ImageListItem } from '@mui/material' | ||
import { Upload } from '../../api/Upload' | ||
import { faXmarkSquare } from '@fortawesome/free-solid-svg-icons' | ||
|
||
interface Props { | ||
onDelete: (upload: Upload) => void | ||
upload: Upload | ||
} | ||
|
||
const AttachmentPreview: FC<Props> = ({ onDelete, upload }) => { | ||
const handleDelete = () => { | ||
onDelete(upload) | ||
} | ||
|
||
return ( | ||
<ImageListItem sx={{ position: 'relative' }}> | ||
<img | ||
src={upload.url} | ||
style={{ | ||
objectFit: 'cover', | ||
}} | ||
/> | ||
<IconButton | ||
onClick={handleDelete} | ||
sx={{ position: 'absolute', right: 0 }} | ||
> | ||
<FontAwesomeIcon icon={faXmarkSquare} /> | ||
</IconButton> | ||
</ImageListItem> | ||
) | ||
} | ||
|
||
export default AttachmentPreview |
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,33 @@ | ||
import { ImageList } from '@mui/material' | ||
import React, { FC } from 'react' | ||
import { Upload } from '../../api/Upload' | ||
import AttachmentPreview from './AttachmentPreview' | ||
|
||
interface Props { | ||
attachments: Upload[] | ||
onDelete: (upload: Upload) => void | ||
} | ||
|
||
const AttachmentsPreview: FC<Props> = ({ attachments, onDelete }) => { | ||
const images = attachments.map((upload, key) => { | ||
return ( | ||
<AttachmentPreview | ||
key={key} | ||
onDelete={() => onDelete(upload)} | ||
upload={upload} | ||
/> | ||
) | ||
}) | ||
|
||
if (images.length === 0) { | ||
return null | ||
} | ||
|
||
return ( | ||
<ImageList cols={3} sx={{ mt: 1 }}> | ||
{images} | ||
</ImageList> | ||
) | ||
} | ||
|
||
export default AttachmentsPreview |
Oops, something went wrong.