-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(client-electron): handle missing source file
fixes #277
- Loading branch information
1 parent
a5bbb5d
commit 6e5c55b
Showing
7 changed files
with
206 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { AppSettings } from '@/electron/common'; | ||
import { MdWarning } from '@react-icons/all-files/md/MdWarning'; | ||
import { PropsWithChildren, ReactElement, useContext } from 'react'; | ||
import styled from 'styled-components'; | ||
import { RouterExtContext } from '../router-ext'; | ||
import { LinkButton } from './Buttons'; | ||
import { Col, Row } from './Flex'; | ||
|
||
const Title = styled.h3` | ||
margin: 0; | ||
font-weight: 600; | ||
color: var(--accent); | ||
text-transform: uppercase; | ||
`; | ||
|
||
const Body = styled.h4` | ||
margin: 0; | ||
font-weight: 600; | ||
color: var(--primary); | ||
`; | ||
|
||
const Link = styled( | ||
({ | ||
setting, | ||
children, | ||
}: PropsWithChildren<{ setting: keyof AppSettings }>) => { | ||
const { navigateToSetting } = useContext(RouterExtContext); | ||
|
||
return ( | ||
<LinkButton onClick={() => navigateToSetting(setting)}> | ||
{children} | ||
</LinkButton> | ||
); | ||
} | ||
)` | ||
color: var(--primary); | ||
font-weight: 600; | ||
`; | ||
|
||
interface WarningProps { | ||
title: ReactElement; | ||
body: ReactElement; | ||
className?: string; | ||
} | ||
|
||
export const Warning = ({ title, body, className }: WarningProps) => { | ||
return ( | ||
<Col className={className}> | ||
<Row style={{ alignItems: 'center' }}> | ||
<MdWarning size="2rem" color="var(--accent)" /> | ||
{title} | ||
</Row> | ||
{body} | ||
</Col> | ||
); | ||
}; | ||
|
||
Warning.Title = Title; | ||
Warning.Body = Body; | ||
Warning.Link = Link; |
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
Oops, something went wrong.