-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): move about page to modal box
- Loading branch information
Showing
7 changed files
with
78 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
4 changes: 2 additions & 2 deletions
4
ui/src/about/AboutPage.test.tsx → ui/src/settings/about/AboutButton.test.tsx
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,10 +1,10 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
|
||
import AboutPage from './AboutPage' | ||
import AboutButton from './AboutButton' | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div') | ||
ReactDOM.render(<AboutPage />, div) | ||
ReactDOM.render(<AboutButton />, div) | ||
ReactDOM.unmountComponentAtNode(div) | ||
}) |
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,63 @@ | ||
/* eslint-disable @typescript-eslint/no-non-null-assertion */ | ||
import React from 'react' | ||
import ReactModal from 'react-modal' | ||
import { useModal } from 'react-modal-hook' | ||
|
||
import ButtonIcon from '../../components/ButtonIcon' | ||
import Panel from '../../components/Panel' | ||
|
||
import dialogStyles from '../../components/Dialog.module.css' | ||
import styles from './AboutButton.module.css' | ||
import logo from './logo.svg' | ||
import { VERSION } from '../../constants' | ||
|
||
interface Props { | ||
closeHandler: () => void | ||
} | ||
|
||
const AboutPanel = ({ closeHandler }: Props) => ( | ||
<Panel className={styles.about}> | ||
<ButtonIcon title="close" onClick={closeHandler} icon="close" /> | ||
<h1> | ||
<img src={logo} /> | ||
</h1> | ||
<span>({VERSION})</span> | ||
<p>Read your Internet article flow in one place with complete peace of mind and freedom.</p> | ||
<ul> | ||
<li> | ||
<a href="https://github.com/ncarlier/readflow" rel="noreferrer noopener" target="_blank"> | ||
Sources | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/ncarlier/readflow/issues" rel="noreferrer noopener" target="_blank"> | ||
Bug or feature request | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://www.paypal.me/nunux" rel="noreferrer noopener" target="_blank"> | ||
Support this project | ||
</a> | ||
</li> | ||
</ul> | ||
</Panel> | ||
) | ||
|
||
export default () => { | ||
const [showAboutModal, hideAboutModal] = useModal(() => ( | ||
<ReactModal | ||
isOpen | ||
shouldCloseOnEsc | ||
shouldCloseOnOverlayClick | ||
shouldFocusAfterRender | ||
appElement={document.getElementById('root')!} | ||
onRequestClose={hideAboutModal} | ||
className={dialogStyles.dialog} | ||
overlayClassName={dialogStyles.overlay} | ||
> | ||
<AboutPanel closeHandler={hideAboutModal} /> | ||
</ReactModal> | ||
)) | ||
|
||
return <ButtonIcon title="About" onClick={showAboutModal} icon="info" /> | ||
} |
File renamed without changes