-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update testing table for patternhub with accessibility review (#…
- Loading branch information
Showing
5 changed files
with
172 additions
and
24 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
41 changes: 41 additions & 0 deletions
41
showcases/patternhub/components/accessibility-review-info/accessibility-review-info.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,41 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { DBInfotext, type SemanticType } from '../../../../output/react/src'; | ||
|
||
export type AccessibilityReviewInfoType = { | ||
name: string; | ||
status: 'DONE' | 'REVIEW' | 'PROGRESS' | string; | ||
date: string; | ||
}; | ||
|
||
const AccessibilityReviewInfo = ( | ||
accessibilityReview?: AccessibilityReviewInfoType | ||
) => { | ||
const [semantic, setSemantic] = useState<SemanticType>('critical'); | ||
const [text, setText] = useState<string>('Missing'); | ||
|
||
useEffect(() => { | ||
if (accessibilityReview && accessibilityReview.status === 'DONE') { | ||
setSemantic('successful'); | ||
setText('Done'); | ||
} else if ( | ||
accessibilityReview && | ||
accessibilityReview.status === 'REVIEW' | ||
) { | ||
setSemantic('warning'); | ||
setText('In review'); | ||
} else if ( | ||
accessibilityReview && | ||
accessibilityReview.status === 'PROGRESS' | ||
) { | ||
setSemantic('warning'); | ||
setText('In progress'); | ||
} else { | ||
setSemantic('critical'); | ||
setText('Missing'); | ||
} | ||
}, [accessibilityReview]); | ||
|
||
return <DBInfotext semantic={semantic}>{text}</DBInfotext>; | ||
}; | ||
|
||
export default AccessibilityReviewInfo; |
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,47 @@ | ||
[ | ||
{ | ||
"name": "drawer", | ||
"status": "REVIEW", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "button", | ||
"status": "REVIEW", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "link", | ||
"status": "DONE", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "input", | ||
"status": "DONE", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "radio", | ||
"status": "REVIEW", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "checkbox", | ||
"status": "REVIEW", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "select", | ||
"status": "DONE", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "infotext", | ||
"status": "DONE", | ||
"date": "2023-11-23" | ||
}, | ||
{ | ||
"name": "notification", | ||
"status": "DONE", | ||
"date": "2023-11-23" | ||
} | ||
] |