PluginProbe
Extendify / trunk
Extendify vtrunk
3.2.1 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 All 127 releases
extendify / src / Assist / components / dashboard / buttons / ModalButton.jsx

ModalButton.jsx in Extendify trunk, at src/Assist/components/dashboard/buttons/ModalButton.jsx

27 lines 853 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { UpdateLogo } from '@assist/components/tasks/UpdateLogo';
2 import { UpdateSiteDescription } from '@assist/components/tasks/UpdateSiteDescription';
3 import { UpdateSiteIcon } from '@assist/components/tasks/UpdateSiteIcon';
4 import { useGlobalStore } from '@assist/state/globals';
5
6 export const ModalButton = ({ task, completed }) => {
7 const { pushModal } = useGlobalStore();
8
9 const Components = {
10 logo: UpdateLogo,
11 'site-description': UpdateSiteDescription,
12 'site-icon': UpdateSiteIcon,
13 };
14
15 if (!Components[task.slug]) return null;
16
17 return (
18 <button
19 type="button"
20 className="min-w-24 rounded-xs bg-design-main px-4 py-2.5 text-sm font-medium text-design-text hover:opacity-90"
21 onClick={() => pushModal(Components[task.slug])}
22 >
23 {completed ? task.buttonLabels.completed : task.buttonLabels.notCompleted}
24 </button>
25 );
26 };
27