-
Notifications
You must be signed in to change notification settings - Fork 14
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 #2589 from coveo/feat-UITOOL-574-sync-feedback
refactor(website, sync feedback): update demo layout
- Loading branch information
Showing
4 changed files
with
67 additions
and
44 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
33 changes: 33 additions & 0 deletions
33
packages/website/src/examples/SyncFeedback/SyncFeedback.example.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import {SyncFeedback, SyncFeedbackState} from '@coveord/plasma-react'; | ||
import * as React from 'react'; | ||
|
||
export default () => ( | ||
<table className="table"> | ||
<tr> | ||
<td>NONE</td> | ||
<td> | ||
<SyncFeedback state={SyncFeedbackState.NONE} /> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>SYNCING</td> | ||
<td> | ||
<SyncFeedback state={SyncFeedbackState.SYNCING} /> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>SUCCESS</td> | ||
<td> | ||
<SyncFeedback state={SyncFeedbackState.SUCCESS} /> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>ERROR</td> | ||
<td> | ||
<SyncFeedback state={SyncFeedbackState.ERROR} /> | ||
</td> | ||
</tr> | ||
</table> | ||
); |
10 changes: 10 additions & 0 deletions
10
packages/website/src/examples/SyncFeedback/SyncFeedbackLabel.example.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {SyncFeedback, SyncFeedbackState} from '@coveord/plasma-react'; | ||
import * as React from 'react'; | ||
|
||
export default () => ( | ||
<> | ||
<SyncFeedback state={SyncFeedbackState.SYNCING} feedback="There is something happening" /> | ||
<SyncFeedback state={SyncFeedbackState.SUCCESS} feedback="There was a success" /> | ||
<SyncFeedback state={SyncFeedbackState.ERROR} feedback="There was an error" /> | ||
</> | ||
); |
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,45 +1,16 @@ | ||
import code from '@examples/SyncFeedback/SyncFeedback.example.tsx'; | ||
import label from '@examples/SyncFeedback/SyncFeedbackLabel.example.tsx'; | ||
import * as React from 'react'; | ||
import {SyncFeedback, SyncFeedbackState} from '@coveord/plasma-react'; | ||
import {PageLayout} from '../../building-blocs/PageLayout'; | ||
|
||
import PlasmaComponent from '../../building-blocs/PlasmaComponent'; | ||
|
||
// start-print | ||
export class SyncFeedbackExample extends React.Component<any, any> { | ||
render() { | ||
return ( | ||
<PlasmaComponent id="SyncFeedback" title="Sync Feedback" withSource> | ||
<div className="mt2"> | ||
<label className="form-control-label">SyncFeedback</label> | ||
<div className="form-control"> | ||
<div className="mb2"> | ||
A SyncFeedback component on state NONE is invisible. | ||
<SyncFeedback state={SyncFeedbackState.NONE} /> | ||
</div> | ||
<div className="mb2"> | ||
There is a default feedback message for each state | ||
<SyncFeedback state={SyncFeedbackState.SYNCING} /> | ||
<SyncFeedback state={SyncFeedbackState.SUCCESS} /> | ||
<SyncFeedback state={SyncFeedbackState.ERROR} /> | ||
</div> | ||
<div className="mb2"> | ||
You can pass a custom feedback message | ||
<SyncFeedback | ||
state={SyncFeedbackState.SYNCING} | ||
feedback="This message is a SyncFeedback component on state SYNCING" | ||
/> | ||
<SyncFeedback | ||
state={SyncFeedbackState.SUCCESS} | ||
feedback="This message is a SyncFeedback component on state SUCCESS" | ||
/> | ||
<SyncFeedback | ||
state={SyncFeedbackState.ERROR} | ||
feedback="This message is a SyncFeedback component on state ERROR" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</PlasmaComponent> | ||
); | ||
} | ||
} | ||
export default SyncFeedbackExample; | ||
export default () => ( | ||
<PageLayout | ||
id="SyncFeedback" | ||
title="Sync Feedback" | ||
section="Feedback" | ||
description="A sync feedback indicates the status of an operation to the user." | ||
componentSourcePath="/numericInput/NumericInputConnected.tsx" | ||
code={code} | ||
examples={{label: {code: label, title: 'Custom Labels'}}} | ||
/> | ||
); |