This repository has been archived by the owner on Nov 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(setup): Error screens & sample implementation
- No Card Reader Attached - Low Power and No Charger Attached - No Printer Attached - Printer Error
- Loading branch information
Showing
5 changed files
with
212 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React, { useEffect } from 'react' | ||
import Prose from '../components/Prose' | ||
import Main, { MainChild } from '../components/Main' | ||
import Screen from '../components/Screen' | ||
import { PartialUserSettings } from '../config/types' | ||
import { DEFAULT_FONT_SIZE, LARGE_DISPLAY_FONT_SIZE } from '../config/globals' | ||
|
||
interface Props { | ||
setUserSettings: (partial: PartialUserSettings) => void | ||
} | ||
|
||
const ExpiredCardScreen = ({ setUserSettings }: Props) => { | ||
useEffect(() => { | ||
setUserSettings({ textSize: LARGE_DISPLAY_FONT_SIZE }) | ||
return () => { | ||
setUserSettings({ textSize: DEFAULT_FONT_SIZE }) | ||
} | ||
}, [setUserSettings]) | ||
|
||
return ( | ||
<Screen white> | ||
<Main> | ||
<MainChild center> | ||
<Prose textCenter> | ||
<h1>Card Reader Not Detected</h1> | ||
<p>Please ask a poll worker to connect card reader.</p> | ||
</Prose> | ||
</MainChild> | ||
</Main> | ||
</Screen> | ||
) | ||
} | ||
|
||
export default ExpiredCardScreen |
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,40 @@ | ||
import React, { useEffect } from 'react' | ||
import Prose from '../components/Prose' | ||
import Main, { MainChild } from '../components/Main' | ||
import Screen from '../components/Screen' | ||
import { NoWrap } from '../components/Text' | ||
import { PartialUserSettings } from '../config/types' | ||
import { DEFAULT_FONT_SIZE, LARGE_DISPLAY_FONT_SIZE } from '../config/globals' | ||
|
||
interface Props { | ||
setUserSettings: (partial: PartialUserSettings) => void | ||
} | ||
|
||
const SetupPowerPage = ({ setUserSettings }: Props) => { | ||
useEffect(() => { | ||
setUserSettings({ textSize: LARGE_DISPLAY_FONT_SIZE }) | ||
return () => { | ||
setUserSettings({ textSize: DEFAULT_FONT_SIZE }) | ||
} | ||
}, [setUserSettings]) | ||
|
||
return ( | ||
<Screen white> | ||
<Main padded> | ||
<MainChild center> | ||
<Prose textCenter> | ||
<h1> | ||
No Power Detected <NoWrap>and Battery is Low</NoWrap> | ||
</h1> | ||
<p> | ||
Please ask a poll worker to plug-in the power cord for this | ||
machine. | ||
</p> | ||
</Prose> | ||
</MainChild> | ||
</Main> | ||
</Screen> | ||
) | ||
} | ||
|
||
export default SetupPowerPage |
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,34 @@ | ||
import React, { useEffect } from 'react' | ||
import Prose from '../components/Prose' | ||
import Main, { MainChild } from '../components/Main' | ||
import Screen from '../components/Screen' | ||
import { PartialUserSettings } from '../config/types' | ||
import { DEFAULT_FONT_SIZE, LARGE_DISPLAY_FONT_SIZE } from '../config/globals' | ||
|
||
interface Props { | ||
setUserSettings: (partial: PartialUserSettings) => void | ||
} | ||
|
||
const SetupPrinterErrorPage = ({ setUserSettings }: Props) => { | ||
useEffect(() => { | ||
setUserSettings({ textSize: LARGE_DISPLAY_FONT_SIZE }) | ||
return () => { | ||
setUserSettings({ textSize: DEFAULT_FONT_SIZE }) | ||
} | ||
}, [setUserSettings]) | ||
|
||
return ( | ||
<Screen white> | ||
<Main padded> | ||
<MainChild center> | ||
<Prose textCenter> | ||
<h1>Printer Error Detected</h1> | ||
<p>Please ask a poll worker to resolve printer error.</p> | ||
</Prose> | ||
</MainChild> | ||
</Main> | ||
</Screen> | ||
) | ||
} | ||
|
||
export default SetupPrinterErrorPage |
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,34 @@ | ||
import React, { useEffect } from 'react' | ||
import Prose from '../components/Prose' | ||
import Main, { MainChild } from '../components/Main' | ||
import Screen from '../components/Screen' | ||
import { PartialUserSettings } from '../config/types' | ||
import { DEFAULT_FONT_SIZE, LARGE_DISPLAY_FONT_SIZE } from '../config/globals' | ||
|
||
interface Props { | ||
setUserSettings: (partial: PartialUserSettings) => void | ||
} | ||
|
||
const SetupPrinterPage = ({ setUserSettings }: Props) => { | ||
useEffect(() => { | ||
setUserSettings({ textSize: LARGE_DISPLAY_FONT_SIZE }) | ||
return () => { | ||
setUserSettings({ textSize: DEFAULT_FONT_SIZE }) | ||
} | ||
}, [setUserSettings]) | ||
|
||
return ( | ||
<Screen white> | ||
<Main padded> | ||
<MainChild center> | ||
<Prose textCenter> | ||
<h1>No Printer Detected</h1> | ||
<p>Please ask a poll worker to connect printer.</p> | ||
</Prose> | ||
</MainChild> | ||
</Main> | ||
</Screen> | ||
) | ||
} | ||
|
||
export default SetupPrinterPage |