-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Election w/ state model and check state on ElectionPage (#32)
- Loading branch information
Showing
11 changed files
with
83 additions
and
32 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,23 @@ | ||
import React from 'react'; | ||
import { Text } from '@fluentui/react'; | ||
import moment from 'moment'; | ||
import { useTheme } from '@fluentui/react-theme-provider'; | ||
|
||
// TODO #?? Resolve internalization of dates using i18n | ||
const dateFormat = 'MM/DD/YYYY h:mm a'; | ||
|
||
export interface ElectionPlaceholderMessageProps { | ||
endDate: string; | ||
} | ||
|
||
const ElectionPlaceholderMessage: React.FunctionComponent<ElectionPlaceholderMessageProps> = ({ endDate }) => { | ||
const theme = useTheme(); | ||
return ( | ||
<Text variant="large" styles={{ root: { color: theme.palette.neutralSecondary } }}> | ||
The election is not finished at this time. Please come back to check for results after | ||
{' ' + moment(endDate).format(dateFormat)}. | ||
</Text> | ||
); | ||
}; | ||
|
||
export default ElectionPlaceholderMessage; |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { ElectionDescription } from '../models/election'; | ||
import { Election } from '../models/election'; | ||
import { ElectionResultsSummary } from '../models/tally'; | ||
import { TrackedBallot } from '../models/tracking'; | ||
|
||
/** | ||
* Provides access to election data and search functionality. | ||
*/ | ||
export interface DataAccess { | ||
getElections(): Promise<ElectionDescription[]>; | ||
getElections(): Promise<Election[]>; | ||
getElectionResults(electionId: string): Promise<ElectionResultsSummary>; | ||
searchBallots(electionId: string, query: string): Promise<TrackedBallot[]>; | ||
} |
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