Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions components/submit/Changes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,35 @@ const Changes = () => {
}

return (
<Flex
flexDirection='column'
mt={2}
pb={4}
>
{data && !error && (
<>
<Box fontWeight='bold'>
<Row change={headerRow} />
</Box>
<Box>
{Object.keys(data.changes)
.sort((cc1, cc2) => (cc2 === 'global' ? 1 : -1))
.map((cc) => (
<ChangeSet key={cc} cc={cc} changes={data.changes[cc]} />
))}
</Box>
<SubmitButton />
</>
)}
</Flex>
<>
<Heading h={4} mb={3}>Proposed Changes</Heading>
<Flex
flexDirection='column'
mt={2}
px={3}
py={2}
mb={4}
sx={{
border: '1px solid black',
}}
>
{data && !error && (
<>
<Box fontWeight='bold'>
<Row change={headerRow} />
</Box>
<Box>
{Object.keys(data.changes)
.sort((cc1, cc2) => (cc2 === 'global' ? 1 : -1))
.map((cc) => (
<ChangeSet key={cc} cc={cc} changes={data.changes[cc]} />
))}
</Box>
<SubmitButton />
</>
)}
</Flex>
</>
)
}

Expand Down
2 changes: 1 addition & 1 deletion components/submit/SubmitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const SubmitButton = () => {
}, [mutate, notify])

return (
<Flex flexDirection={['column']} py={3} mb={4}>
<Flex flexDirection={['column']} py={2} >
<Flex my={[2, 2]}>
{isClean && (
<Box>
Expand Down
4 changes: 2 additions & 2 deletions components/submit/UrlList.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ const UrlList = ({ cc }) => {
<Flex flexDirection='column' my={2}>
{data && !error && (
<>
<Box py={2}>
<Box py={2} mb={3}>
<EditForm
layout='row'
onSubmit={handleSubmit}
oldEntry={{}}
error={addFormError}
/>
</Box>

<Heading h={4} mb={2}>Test List</Heading>
<Table
data={data}
onEdit={onEdit}
Expand Down
9 changes: 6 additions & 3 deletions pages/[cc].js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback } from 'react'
import { useRouter } from 'next/router'
import { Heading } from 'ooni-components'
import { Heading, Box } from 'ooni-components'

import Layout from '../components/Layout'
import CountryList from '../components/submit/CountryList'
Expand Down Expand Up @@ -31,9 +31,12 @@ export default function Submit () {
<Layout title='Url Submission'>
<Notification />
<PageContextProvider countryCode={countryCode}>
<Heading h={2} mt={3} mb={4}>Test List Editor</Heading>
<Changes />
<Heading h={1}>Test List</Heading>
<CountryList defaultValue={countryCode} onChange={onCountryChange} />
<Heading h={4} mb={3}>Country</Heading>
<Box mb={4}>
<CountryList defaultValue={countryCode} onChange={onCountryChange} />
</Box>
{countryCode && <UrlList cc={countryCode} />}
</PageContextProvider>
</Layout>
Expand Down