Skip to content

Commit ed21220

Browse files
committed
add minor ui changes and remove search
1 parent 6de582f commit ed21220

File tree

4 files changed

+49
-60
lines changed

4 files changed

+49
-60
lines changed

packages/frontend/src/components/Editor/index.tsx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Flex,
1313
useDisclosure,
1414
} from '@chakra-ui/react'
15-
import { IconButton } from '@opengovsg/design-system-react'
15+
import { IconButton, TouchableTooltip } from '@opengovsg/design-system-react'
1616

1717
import FlowStep from '@/components/FlowStep'
1818
import FlowStepGroup from '@/components/FlowStepGroup'
@@ -54,25 +54,35 @@ function AddStepButton(props: AddStepButtonProps): JSX.Element {
5454
<>
5555
<Box pos="relative" h={24}>
5656
{/* Top vertical line */}
57-
<Box h="1.875rem">
57+
<Box mt={2} h={5}>
5858
<Divider orientation="vertical" borderColor="base.divider.strong" />
5959
</Box>
6060
{/* Bottom vertical line */}
6161
{!isLastStep && (
62-
<Box mt={9} h="1.875rem">
62+
<Box mt={10} h={5}>
6363
<Divider orientation="vertical" borderColor="base.divider.strong" />
6464
</Box>
6565
)}
6666
<AbsoluteCenter>
67-
<IconButton
68-
// onClick={onClick}
69-
onClick={onOpen}
70-
isDisabled={isDisabled}
71-
aria-label="Add Step"
72-
icon={<BiPlus />}
73-
variant="outline"
74-
size="xs"
75-
/>
67+
<TouchableTooltip label="Add Step" placement="right">
68+
<IconButton
69+
onClick={onOpen}
70+
isDisabled={isDisabled}
71+
aria-label="Add Step"
72+
icon={<BiPlus />}
73+
variant={isLastStep ? 'outline' : 'clear'}
74+
size="xs"
75+
color="interaction.sub.default"
76+
borderRadius="full"
77+
_hover={{
78+
bg: 'interaction.muted.neutral.hover',
79+
}}
80+
_active={{
81+
bg: 'interaction.muted.neutral.active',
82+
}}
83+
borderColor={isLastStep ? 'interaction.sub.default' : undefined}
84+
/>
85+
</TouchableTooltip>
7686
</AbsoluteCenter>
7787
</Box>
7888

packages/frontend/src/components/EmptyFlowStepHeader/EmptyFlowStepHeaderModal/ModalBodyContent.tsx

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import type { IAction, IApp, ITrigger } from '@plumber/types'
22

3-
import { useContext, useMemo, useState } from 'react'
4-
import { BiArrowFromRight, BiChevronRight, BiSearch } from 'react-icons/bi'
5-
import {
6-
Box,
7-
Flex,
8-
Icon,
9-
Image,
10-
InputGroup,
11-
InputLeftElement,
12-
Text,
13-
} from '@chakra-ui/react'
14-
import { Badge, Input } from '@opengovsg/design-system-react'
3+
import { useContext, useMemo } from 'react'
4+
import { BiArrowFromRight, BiChevronRight } from 'react-icons/bi'
5+
import { Box, Flex, Icon, Image, Text } from '@chakra-ui/react'
6+
import { Badge } from '@opengovsg/design-system-react'
157
import { groupBy } from 'lodash'
168

179
import { getAppActionFlag, getAppFlag, getAppTriggerFlag } from '@/config/flags'
@@ -43,22 +35,16 @@ export default function ModalBodyContent(
4335
const [_, isInitializingIfThen] = useIfThenInitializer()
4436
const isLoading = launchDarkly.isLoading || isInitializingIfThen
4537

46-
const [searchQuery, setSearchQuery] = useState('')
47-
4838
// Combine filtering and grouping logic into a single operation
4939
const groupedApps = useMemo(() => {
50-
const filteredApps = apps
51-
?.filter((app) => {
52-
// Filter away apps hidden behind feature flags
53-
if (isLoading || !launchDarkly.flags || !app?.key) {
54-
return true
55-
}
56-
const ldAppFlag = getAppFlag(app.key)
57-
return launchDarkly.flags[ldAppFlag] ?? true
58-
})
59-
.filter((app) =>
60-
app.name.toLowerCase().includes(searchQuery.toLowerCase()),
61-
)
40+
const filteredApps = apps?.filter((app) => {
41+
// Filter away apps hidden behind feature flags
42+
if (isLoading || !launchDarkly.flags || !app?.key) {
43+
return true
44+
}
45+
const ldAppFlag = getAppFlag(app.key)
46+
return launchDarkly.flags[ldAppFlag] ?? true
47+
})
6248

6349
// Group the filtered apps
6450
const grouped = groupBy(
@@ -76,7 +62,7 @@ export default function ModalBodyContent(
7662
}
7763
return a[0].localeCompare(b[0])
7864
})
79-
}, [apps, searchQuery, launchDarkly.flags, isLoading])
65+
}, [apps, launchDarkly.flags, isLoading])
8066

8167
const filteredTriggersOrActions = useMemo(() => {
8268
if (!selectedApp) {
@@ -173,21 +159,6 @@ export default function ModalBodyContent(
173159
*/
174160
return (
175161
<Flex flexDir="column" gap={6}>
176-
<InputGroup>
177-
<InputLeftElement pointerEvents="none">
178-
<Icon as={BiSearch} color="base.content.medium" />
179-
</InputLeftElement>
180-
<Input
181-
placeholder="Search for apps..."
182-
value={searchQuery}
183-
onChange={(e) => setSearchQuery(e.target.value)}
184-
_focus={{
185-
borderColor: 'primary.500',
186-
boxShadow: '0 0 0 1px var(--chakra-colors-primary-500)',
187-
}}
188-
/>
189-
</InputGroup>
190-
191162
{groupedApps && groupedApps.length === 0 ? (
192163
<Flex
193164
justifyContent="center"

packages/frontend/src/components/EmptyFlowStepHeader/EmptyFlowStepHeaderModal/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@ export default function EmptyFlowStepHeaderModal(
5959
autoFocus={false}
6060
>
6161
<ModalOverlay bg="base.canvas.overlay" />
62-
<ModalContent>
62+
<ModalContent
63+
maxW="600px"
64+
maxH="90vh"
65+
h="auto"
66+
overflow="hidden"
67+
borderRadius="lg"
68+
>
6369
<ModalHeader>
6470
{selectedApp ? (
6571
<Flex gap={2} flexDir="column" alignItems="flex-start">
@@ -78,7 +84,7 @@ export default function EmptyFlowStepHeaderModal(
7884
<Text textStyle="h3-semibold" pt={4}>
7985
{isTrigger
8086
? 'Choose how you want your workflow to start'
81-
: 'Choose which action you want to run next'}
87+
: 'Add steps'}
8288
</Text>
8389
)}
8490
</ModalHeader>

packages/frontend/src/components/EmptyFlowStepHeader/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export default function EmptyFlowStepHeader(
2424
borderRadius="lg"
2525
bg="white"
2626
p={4}
27-
justifyContent="center"
27+
pl={8}
28+
h="96px"
29+
// justifyContent="flex-start"
2830
alignItems="center"
2931
gap={4}
3032
onClick={onOpen}
@@ -36,11 +38,11 @@ export default function EmptyFlowStepHeader(
3638
bg: 'interaction.muted.neutral.active',
3739
}}
3840
>
39-
<Icon as={isTrigger ? BiSolidBolt : BiRun} />
40-
<Text>
41+
<Icon as={isTrigger ? BiSolidBolt : BiRun} boxSize={6} />
42+
<Text textStyle="subhead-1">
4143
{isTrigger
4244
? 'Choose how you want your workflow to start'
43-
: 'Choose which action you want to run next'}
45+
: 'Choose an action'}
4446
</Text>
4547
</Flex>
4648

0 commit comments

Comments
 (0)