Skip to content

Commit 72b2dd7

Browse files
committed
fix: mobile mode
1 parent 5e4c240 commit 72b2dd7

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

packages/frontend/src/pages/AiBuilder/components/AIFormModalContent.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ export const AIFormModalContent = ({
108108
</Flex>
109109
</ModalBody>
110110
<ModalFooter>
111-
<Flex justifyContent="space-between" alignItems="center" w="100%">
111+
<Flex
112+
justifyContent={isMobile ? 'flex-end' : 'space-between'}
113+
alignItems="center"
114+
w="100%"
115+
>
112116
{!isMobile && (
113117
<Flex gap={1} alignItems="center" justifyContent="center">
114118
<Text fontSize="xs" color="gray.500">

packages/frontend/src/pages/AiBuilder/components/ChatInterface/PromptInput.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
import { FaArrowCircleRight } from 'react-icons/fa'
99
import { FaCircleStop } from 'react-icons/fa6'
1010
import { Box, Flex, Icon, Text, Textarea } from '@chakra-ui/react'
11+
import { useIsMobile } from '@opengovsg/design-system-react'
1112

1213
import pairLogo from '@/assets/pair-logo.svg'
1314
import { ImageBox } from '@/components/FlowStepConfigurationModal/ChooseAndAddConnection/ConfigureExcelConnection'
@@ -29,6 +30,7 @@ export default function PromptInput({
2930
sendMessage,
3031
cancelStream,
3132
}: PromptInputProps) {
33+
const isMobile = useIsMobile()
3234
const [input, setInput] = useState<string>('')
3335
const textareaRef = useRef<HTMLTextAreaElement>(null)
3436

@@ -74,7 +76,7 @@ export default function PromptInput({
7476
w="full"
7577
minH={showIdeas ? '120px' : '50px'}
7678
height="auto"
77-
mb={6}
79+
mb={isMobile ? 0 : 6}
7880
>
7981
<Textarea
8082
ref={textareaRef}
@@ -157,12 +159,14 @@ export default function PromptInput({
157159
/>
158160
)}
159161

160-
<Flex gap={1} alignItems="center" justify="center" mt={3}>
161-
<Text fontSize="xs" color="gray.500">
162-
Powered by{' '}
163-
</Text>
164-
<ImageBox imageUrl={pairLogo} boxSize={6} />
165-
</Flex>
162+
{!isMobile && (
163+
<Flex gap={1} alignItems="center" justify="center" mt={3}>
164+
<Text fontSize="xs" color="gray.500">
165+
Powered by{' '}
166+
</Text>
167+
<ImageBox imageUrl={pairLogo} boxSize={6} />
168+
</Flex>
169+
)}
166170
</Box>
167171
)
168172
}

packages/frontend/src/pages/AiBuilder/components/IdeaButtons.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ export default function IdeaButtons({
2525
Try:
2626
</FormLabel>
2727
<Flex
28-
flexDir="row"
28+
flexDir={isMobile ? 'column' : 'row'}
2929
gap={2}
3030
justifyContent="space-between"
3131
flexWrap="wrap"
32+
w={isMobile ? 'full' : 'auto'}
3233
>
3334
{ideas.map((idea) => (
3435
<Button
@@ -43,7 +44,7 @@ export default function IdeaButtons({
4344
onClick={() => onClick(idea)}
4445
px={isForm ? 2 : 3}
4546
minH={4}
46-
w={isMobile ? 'calc(50% - 4px)' : 'auto'}
47+
w={isMobile ? 'full' : 'auto'}
4748
flexShrink={0}
4849
>
4950
<TemplateIcon iconName={idea.icon} fontSize="1rem" />

0 commit comments

Comments
 (0)