Skip to content

Commit

Permalink
chore: delete old ui components + organise files
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rita committed Dec 9, 2024
1 parent 66e0293 commit 0cadab5
Show file tree
Hide file tree
Showing 40 changed files with 49 additions and 1,108 deletions.
6 changes: 2 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { FC } from 'react'
import { RouterProvider } from 'react-router-dom'
import AppWrapper from './components/AppWrapper'
import { pagerRouter } from './components/pager/routes/PagerRouter'
// import { router } from './routes/Router'
import { router } from './routes/Router'

const App: FC = () => {
return (
<AppWrapper>
{/* <RouterProvider router={router} /> */}
<RouterProvider router={pagerRouter} />
<RouterProvider router={router} />
</AppWrapper>
)
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Link, useLocation, useMatches } from 'react-router-dom'
import classes from './Page.module.css'
import classes from '../Page.module.css'

function Breadcrumbs() {
const matches = useMatches()
Expand All @@ -9,7 +9,9 @@ function Breadcrumbs() {
const finalMatch = matches.filter(
(match) => match.pathname === location.pathname
)
const { params: { store, namespace, key } } = finalMatch[0]
const {
params: { store, namespace, key },
} = finalMatch[0]

const storeLabels = {
dataStore: 'DataStore',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Tab, TabBar } from '@dhis2/ui'
import React from 'react'
import i18n from '../../locales'
import i18n from '../locales'

type DataStoreProps = {
activeTab: string
Expand Down
File renamed without changes.
20 changes: 0 additions & 20 deletions src/components/EmptyArea.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions src/components/Error.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import classes from '../Page.module.css'
import Breadcrumbs from './Breadcrumbs'
import classes from './Page.module.css'

type HeaderProps = {
children?: React.ReactElement
Expand Down
17 changes: 0 additions & 17 deletions src/components/Loader.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { InputField } from '@dhis2/ui'
import React from 'react'
import i18n from '../../locales'
import classes from './Page.module.css'
import i18n from '../locales'
import classes from '../Page.module.css'

const SearchField = ({ placeholder }: { placeholder?: string }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TableHead,
} from '@dhis2/ui'
import React from 'react'
import i18n from '../../../locales'
import i18n from '../locales'
import TableActions from './actions/TableActions'

type TableProps = {
Expand Down Expand Up @@ -42,9 +42,7 @@ const ItemsTable = ({ data, label }: TableProps) => {
{item}
</DataTableCell>
<DataTableCell bordered width="12%">
<TableActions
item={item}
/>
<TableActions item={item} />
</DataTableCell>
</DataTableRow>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import { IconDelete16, IconEdit16, IconMore16 } from '@dhis2/ui-icons'
import { IconEdit16, IconMore16 } from '@dhis2/ui-icons'
import { Button } from '@dhis2-ui/button'
import React from 'react'
import i18n from '../../../locales'

export function DeleteButton() {
return (
<Button
aria-label={i18n.t('Delete')}
icon={<IconDelete16 />}
name="create"
onClick={() => console.log('delete')}
title={i18n.t('Delete')}
/>
)
}
import i18n from '../../locales'

export function EditButton({ handleClick }: { handleClick: () => void }) {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react'
import i18n from '../../locales'
import CreateButton from './buttons/CreateButton'
import CreateButton from './CreateButton'
import CreateModal from './CreateModal'

type CreateActionProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, colors } from '@dhis2/ui'
import { IconAdd24 } from '@dhis2/ui-icons'
import React from 'react'
import classes from '../Page.module.css'
import classes from '../../Page.module.css'

type CreateButtonProps = {
label: string
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IconDelete16 } from '@dhis2/ui-icons'
import { Button } from '@dhis2-ui/button'
import React from 'react'
import i18n from '../../../../locales'
import i18n from '../../locales'

export default function DeleteButton({
openModal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ButtonStrip,
} from '@dhis2/ui'
import React from 'react'
import i18n from '../../../../locales'
import i18n from '../../locales'

type DeleteModalProps = {
closeModal: () => void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import { ContextButton, EditButton } from '../../buttons/Buttons'
import classes from '../../Page.module.css'
import { ContextButton, EditButton } from './Buttons'
import DeleteButton from './DeleteButton'
import DeleteModal from './DeleteModal'

Expand Down
80 changes: 0 additions & 80 deletions src/components/create/CreateModal.tsx

This file was deleted.

Loading

0 comments on commit 0cadab5

Please sign in to comment.