Skip to content

Commit

Permalink
use ui-components for button/dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
svirs committed Aug 16, 2024
1 parent feed718 commit bb0db58
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/sanity/src/core/studio/screens/RequestAccessScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable i18next/no-literal-string,@sanity/i18n/no-attribute-string-literals */
import {Box, Button, Card, Dialog, Flex, Stack, Text, TextInput, useToast} from '@sanity/ui'
import {Box, Card, Flex, Stack, Text, TextInput, useToast} from '@sanity/ui'
import {addWeeks, isAfter, isBefore} from 'date-fns'
import {useCallback, useEffect, useState} from 'react'
import {
Expand All @@ -10,6 +10,7 @@ import {
useActiveWorkspace,
} from 'sanity'

import {Button, Dialog} from '../../../ui-components'
import {NotAuthenticatedScreen} from './NotAuthenticatedScreen'

interface AccessRequest {
Expand Down Expand Up @@ -158,7 +159,7 @@ export function RequestAccessScreen() {
if (error) return <NotAuthenticatedScreen />
return (
<Card height="fill">
<Dialog id="not-authorized-dialog" header="Not authorized" width={1} animate>
<Dialog id="not-authorized-dialog" header="Not authorized" width={1}>
<Box>
<Stack padding={4} space={4}>
<Text>
Expand Down Expand Up @@ -218,17 +219,10 @@ export function RequestAccessScreen() {
)}
</Stack>
<Flex align={'center'} justify={'space-between'} paddingY={3} paddingX={4}>
<Button
mode="bleed"
padding={3}
text={'Sign out'}
tone="default"
onClick={handleLogout}
/>
<Button mode="bleed" text={'Sign out'} tone="default" onClick={handleLogout} />
{!hasTooManyRequests && (
<Button
mode="default"
padding={3}
text={hasPendingRequest ? 'Request sent' : 'Request access'}
disabled={hasPendingRequest || isSubmitting}
loading={isSubmitting}
Expand Down

0 comments on commit bb0db58

Please sign in to comment.