diff --git a/src/Contexts.tsx b/src/Contexts.tsx index e4ce7a4..4da1535 100644 --- a/src/Contexts.tsx +++ b/src/Contexts.tsx @@ -2,7 +2,13 @@ import { createContext, useContext, useEffect, useState } from 'react'; import { ThemeProvider } from 'styled-components'; import { ConfigProvider, theme as antdTheme } from 'antd'; import { Configuration } from './configuration/type'; -import { DEFAULT_THEME, getSetting, isDarkTheme, THEME_LIST } from './theme'; +import { + DEFAULT_THEME, + getColor, + getSetting, + isDarkTheme, + THEME_LIST, +} from './theme'; export interface ConnectToFunc { (params: object): void; @@ -73,6 +79,7 @@ export function ThemeContextProvider({ {children} diff --git a/src/component/Connection/ConnectionPage.tsx b/src/component/Connection/ConnectionPage.tsx index fc9c400..144e861 100644 --- a/src/component/Connection/ConnectionPage.tsx +++ b/src/component/Connection/ConnectionPage.tsx @@ -1,4 +1,5 @@ import { Link, Navigate } from 'react-router-dom'; +import { Button } from 'antd'; import { ConnectionObject } from './types'; import { ConnectionContext, useConfiguration } from '../../Contexts'; import { useContext } from 'react'; @@ -24,20 +25,26 @@ function ConnectionPage() { {connectionList.map( (connection: ConnectionObject): JSX.Element => (
- { - e.preventDefault(); - - connectTo(connection); - }} - > - {connection.name} - +
) )} - New connection + +
+ + ); } diff --git a/src/component/Connection/Nav.tsx b/src/component/Connection/Nav.tsx index 25dfdfd..0073db4 100644 --- a/src/component/Connection/Nav.tsx +++ b/src/component/Connection/Nav.tsx @@ -1,5 +1,6 @@ import { Link } from 'react-router-dom'; import { ReactElement, useContext } from 'react'; +import { Button } from 'antd'; import cn from 'classnames'; import { ConnectionContext } from '../../Contexts'; @@ -13,27 +14,31 @@ export default function Nav(): ReactElement { return ( ); } diff --git a/src/component/DatabaseSelector.tsx b/src/component/DatabaseSelector.tsx index eabdc27..7baa958 100644 --- a/src/component/DatabaseSelector.tsx +++ b/src/component/DatabaseSelector.tsx @@ -1,5 +1,6 @@ import { ConnectionContext, DatabaseContext } from '../Contexts'; -import { ChangeEvent, useContext, useEffect, useState } from 'react'; +import { useContext, useEffect, useState } from 'react'; +import { Select } from 'antd'; interface DatabaseRow { Database: string; @@ -21,15 +22,13 @@ export default function DatabaseSelector() { }); }, [currentConnectionName, setDatabase]); - const handleChange = (event: ChangeEvent) => { - setDatabase(event.target.value); - }; - return ( - + { - changeTheme(e.target.value); - }} + + options={Object.keys(THEME_LIST).map((key) => ({ + value: key, + label: key, + }))} + /> ); } diff --git a/src/routes/home.tsx b/src/routes/home.tsx index 67541e4..8bffa8e 100644 --- a/src/routes/home.tsx +++ b/src/routes/home.tsx @@ -1,11 +1,14 @@ import { Link } from 'react-router-dom'; +import { Button } from 'antd'; export function Home() { return (

Welcome to Tiana Tables !

- Please connect +
); } diff --git a/src/routes/root.tsx b/src/routes/root.tsx index cb90941..ec9dbf6 100644 --- a/src/routes/root.tsx +++ b/src/routes/root.tsx @@ -35,8 +35,7 @@ export default function Root() {

Welcome to Tiana Tables !

- Theme: - + Theme: