PluginProbe
Extendify / 0.9.3
Extendify v0.9.3
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Onboarding / components / Card.js

Card.js in Extendify 0.9.3, at src/Onboarding/components/Card.js

65 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import classNames from 'classnames'
2 import { Checkmark } from '@onboarding/svg'
3
4 export const Card = ({
5 image,
6 heading,
7 name,
8 description,
9 selected,
10 onClick,
11 lock,
12 }) => {
13 return (
14 <div
15 role={lock ? undefined : 'button'}
16 tabIndex={lock ? undefined : 0}
17 aria-label={lock ? undefined : name}
18 className={classNames(
19 'text-base p-0 bg-transparent overflow-hidden rounded-lg border border-gray-100',
20 {
21 'button-focus': !lock,
22 },
23 )}
24 onKeyDown={(e) => {
25 if (['Enter', 'Space', ' '].includes(e.key)) {
26 if (!lock) onClick()
27 }
28 }}
29 onClick={() => {
30 if (!lock) onClick()
31 }}>
32 <div className="border-gray-100 border-b p-2 flex justify-between min-w-sm">
33 <div
34 className={classNames('flex items-center', {
35 'text-gray-700': !selected,
36 })}>
37 <span className="text-left">{name}</span>
38 {lock && (
39 <span className="w-4 h-4 text-base leading-none pl-2 mr-6 dashicons dashicons-lock"></span>
40 )}
41 </div>
42 {(lock || selected) && (
43 <Checkmark className="text-partner-primary-bg w-6" />
44 )}
45 </div>
46 <div className="flex flex-col">
47 {image ? (
48 <div
49 style={{ backgroundImage: `url(${image})` }}
50 className="h-32 bg-cover"
51 />
52 ) : (
53 <div className="h-32 bg-gray-100" />
54 )}
55 <div className="p-6">
56 <div className="text-left text-base font-bold mb-2">
57 {heading}
58 </div>
59 <div className="text-left text-sm">{description}</div>
60 </div>
61 </div>
62 </div>
63 )
64 }
65