Skip to content

Commit

Permalink
Merge pull request #74 from delta10/feat/70-buttons-nlds-comp
Browse files Browse the repository at this point in the history
Feat/70 Buttons nlds comp
  • Loading branch information
justiandevs authored Nov 8, 2024
2 parents 9988172 + 312e23e commit 42d1573
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const LocationSelect = ({ field }: LocationSelectProps) => {
formStoreState.coordinates[0] === 0 &&
formStoreState.coordinates[1] === 0 ? (
<Button
appearance="primary-action-button"
id="location-button"
className="absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 border-none"
type="button"
Expand Down
23 changes: 6 additions & 17 deletions src/app/[locale]/incident/components/IncidentFormFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use client'

import React from 'react'
import { cn } from '@/lib/utils/style'
import { useTranslations } from 'next-intl'
import { Button } from '@/components/ui/Button'
import { Button, ButtonGroup } from '@/components/index'
import { useStepperStore } from '@/store/stepper_store'
import { steps, usePathname as usePath, useRouter } from '@/routing/navigation'
import { ImSpinner8 } from 'react-icons/im'
Expand Down Expand Up @@ -37,45 +36,35 @@ const IncidentFormFooter = ({

return (
<>
<div
className={cn(
`bg-gray-200 w-full p-4 flex justify-end ${
step != 1 && pathname != '/incident' ? 'justify-between' : ''
}`,
className
)}
>
<ButtonGroup>
{step != 1 && pathname != '/incident' && (
<Button
variant="transparent"
appearance="secondary-action-button"
type="button"
className="justify-self-start self-start"
onClick={() => goBack()}
>
{t('back_button')}
</Button>
)}
{step < 4 && (
<Button variant="primary" type="submit" className="justify-self-end">
<Button appearance="primary-action-button" type="submit">
{t('next_button')}
</Button>
)}
{step === 4 && (
// Note: current button has no visual indicator when disabled.
<Button
variant="primary"
appearance="primary-action-button"
type="submit"
disabled={loading}
tabIndex={loading ? 0 : undefined}
aria-describedby={ariaDescribedById}
className="flex items-center gap-2 justify-self-end"
onClick={() => (handleSignalSubmit ? handleSignalSubmit() : null)}
>
{loading && <ImSpinner8 className="animate-spin" />}
{t('submit_button')}
</Button>
)}
</div>
</ButtonGroup>
</>
)
}
Expand Down
4 changes: 1 addition & 3 deletions src/app/[locale]/incident/components/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { Paths, usePathname } from '@/routing/navigation'
import { useStepperStore } from '@/store/stepper_store'
import { useEffect, useRef } from 'react'
import { useFormStore } from '@/store/form_store'
import { Button, Link } from '@utrecht/component-library-react/dist/css-module'

import { Paragraph } from '@/components/index'
import { Button, Link, Paragraph } from '@/components/index'

type StepperProps = {}

Expand Down
4 changes: 3 additions & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ export { Select, Container }

export {
Alert,
Heading,
Button,
ButtonGroup,
Heading,
HeadingGroup,
Link,
Image,
Paragraph,
PreHeading,
Icon,
Expand Down
52 changes: 0 additions & 52 deletions src/components/ui/Button.tsx

This file was deleted.

0 comments on commit 42d1573

Please sign in to comment.