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
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module.exports = {
rules: {
// A temporary hack related to IDE not resolving correct package.json
'import/no-extraneous-dependencies': 'off',
'react/jsx-props-no-spreading': 'off',
'react/prop-types': 'off',
},
parserOptions: {
ecmaVersion: 2020,
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
"@babel/preset-typescript": "^7.12.7",
"@babel/register": "^7.12.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@popperjs/core": "^2.9.2",
"@teamsupercell/typings-for-css-modules-loader": "^2.4.0",
"@testing-library/jest-dom": "^5.11.10",
"@testing-library/react": "^11.2.7",
Expand Down Expand Up @@ -238,7 +239,10 @@
"postcss": "^8.3.0",
"postcss-loader": "^5.3.0",
"prettier": "^2.3.0",
"react-contenteditable": "^3.3.5",
"react-popper": "^2.2.5",
"react-refresh": "^0.9.0",
"react-table": "^7.7.0",
"react-test-renderer": "^17.0.1",
"rimraf": "^3.0.0",
"sass-loader": "^11.1.1",
Expand Down
174 changes: 174 additions & 0 deletions src/components/Icons/Icons.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import React from 'react';

export default function getIcons(icon) {
switch (icon) {
case 'plus':
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="12" y1="5" x2="12" y2="19" />
<line x1="5" y1="12" x2="19" y2="12" />
</svg>
);

case 'arrowdown':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="12" y1="5" x2="12" y2="19" />
<line x1="18" y1="13" x2="12" y2="19" />
<line x1="6" y1="13" x2="12" y2="19" />
</svg>
);

case 'arrowup':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="12" y1="5" x2="12" y2="19" />
<line x1="18" y1="11" x2="12" y2="5" />
<line x1="6" y1="11" x2="12" y2="5" />
</svg>
);
case 'arrowleft':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="5" y1="12" x2="19" y2="12" />
<line x1="5" y1="12" x2="11" y2="18" />
<line x1="5" y1="12" x2="11" y2="6" />
</svg>
);
case 'arrowright':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="5" y1="12" x2="19" y2="12" />
<line x1="13" y1="18" x2="19" y2="12" />
<line x1="13" y1="6" x2="19" y2="12" />
</svg>
);
case 'hash':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="5" y1="9" x2="19" y2="9" />
<line x1="5" y1="15" x2="19" y2="15" />
<line x1="11" y1="4" x2="7" y2="20" />
<line x1="17" y1="4" x2="13" y2="20" />
</svg>
);
case 'multi':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<rect x="7" y="3" width="14" height="14" rx="2" />
<path d="M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2" />
</svg>
);
case 'text':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="4" y1="6" x2="20" y2="6" />
<line x1="4" y1="12" x2="14" y2="12" />
<line x1="4" y1="18" x2="18" y2="18" />
</svg>
);
case 'trash':
return (
<svg
width="22"
height="22"
viewBox="0 0 24 24"
strokeWidth="1.5"
stroke="#2c3e50"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<line x1="4" y1="7" x2="20" y2="7" />
<line x1="10" y1="11" x2="10" y2="17" />
<line x1="14" y1="11" x2="14" y2="17" />
<path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" />
<path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" />
</svg>
);
default:
return <div>noIcon</div>;
}
}
15 changes: 12 additions & 3 deletions src/components/MainScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import DbSession from '../sessions/DbSession';
import SqlExecuter from './SqlExecuter';
import TableScreen from './TableScreen/TableScreen';

interface MainScreenProps {
session: DbSession;
Expand All @@ -23,22 +24,30 @@ const MainScreen: React.FC<MainScreenProps> = ({
</button>
<button
type="button"
className={`h-20 ${selectedTab === 'SQL' && 'bg-blue-200'}`}
className={`h-20 ${selectedTab === 'SQL' && 'bg-blue-300'}`}
onClick={() => setSelectedTab('SQL')}
>
SQL
</button>
<button
type="button"
className={`h-20 text-xs ${selectedTab === 'TABLE' && 'bg-blue-200'}`}
className={`h-20 text-xs ${selectedTab === 'TABLE' && 'bg-blue-300'}`}
onClick={() => setSelectedTab('TABLE')}
>
Tables/Views
</button>
<button
type="button"
className={`h-20 text-xs ${selectedTab === 'TEST' && 'bg-blue-300'}`}
onClick={() => setSelectedTab('TEST')}
>
Test
</button>
</div>
<div className="bg-gray-100 w-11/12 flex flex-row">
{selectedTab === 'SQL' && <SqlExecuter session={session} />}
{selectedTab === 'TABLE' && <div>Test</div>}
{selectedTab === 'TABLE' && <TableScreen />}
{selectedTab === 'TEST' && <div>Test</div>}
</div>
</div>
);
Expand Down
Loading