chore: update web dependencies (#102)

* chore: update deps

* chore: remove craco

* chore: fix exports

* fix: filters list indexer bg

* fix: extend theme with correct color
This commit is contained in:
Raghu Saxena 2022-02-05 20:27:44 +08:00 committed by GitHub
parent c35744dc3a
commit 0076ea9129
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 4316 additions and 7268 deletions

View file

@ -1,10 +0,0 @@
module.exports = {
style: {
postcss: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
}

View file

@ -5,7 +5,6 @@
"proxy": "http://127.0.0.1:8989", "proxy": "http://127.0.0.1:8989",
"homepage": ".", "homepage": ".",
"dependencies": { "dependencies": {
"@craco/craco": "^6.1.2",
"@headlessui/react": "^1.2.0", "@headlessui/react": "^1.2.0",
"@heroicons/react": "^1.0.1", "@heroicons/react": "^1.0.1",
"date-fns": "^2.25.0", "date-fns": "^2.25.0",
@ -18,15 +17,15 @@
"react-query": "^3.18.1", "react-query": "^3.18.1",
"react-ridge-state": "^4.2.2", "react-ridge-state": "^4.2.2",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-scripts": "4.0.3", "react-scripts": "^5.0.0",
"react-select": "5.0.0-beta.0", "react-select": "5.0.0-beta.0",
"react-table": "^7.7.0", "react-table": "^7.7.0",
"web-vitals": "^1.0.1" "web-vitals": "^1.0.1"
}, },
"scripts": { "scripts": {
"start": "craco start", "start": "react-scripts start",
"build": "craco build", "build": "react-scripts build",
"test": "craco test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"eslintConfig": { "eslintConfig": {
@ -48,19 +47,19 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^9", "@tailwindcss/forms": "^0.4.0",
"postcss": "^7",
"typescript": "^4.1.2",
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
"@tailwindcss/forms": "^0.3.2",
"@testing-library/jest-dom": "^5.11.4", "@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0", "@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10", "@testing-library/user-event": "^12.1.10",
"@types/react-router-dom": "^5.1.7",
"@types/react-table": "^7.7.7",
"@types/jest": "^26.0.15", "@types/jest": "^26.0.15",
"@types/node": "^12.0.0", "@types/node": "^12.0.0",
"@types/react": "^17.0.0", "@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0" "@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.7",
"@types/react-table": "^7.7.7",
"autoprefixer": "^10.4.2",
"postcss": "^8.4.6",
"tailwindcss": "^3.0.18",
"typescript": "^4.1.2"
} }
} }

6
web/postcss.config.js Normal file
View file

@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}

View file

@ -21,7 +21,7 @@ function Protected() {
export const queryClient = new QueryClient(); export const queryClient = new QueryClient();
function App() { export function App() {
const authContext = AuthContext.useValue(); const authContext = AuthContext.useValue();
const settings = SettingsContext.useValue(); const settings = SettingsContext.useValue();
return ( return (
@ -39,6 +39,4 @@ function App() {
) : null} ) : null}
</QueryClientProvider> </QueryClientProvider>
) )
}; };
export default App;

View file

@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import './index.css'; import './index.css';
import App from "./App"; import { App } from "./App";
import { InitializeGlobalContext } from "./utils/Context"; import { InitializeGlobalContext } from "./utils/Context";

View file

@ -1,6 +1,5 @@
import formatDistanceToNowStrict from 'date-fns/formatDistanceToNowStrict' import formatDistanceToNowStrict from 'date-fns/formatDistanceToNowStrict'
import React from 'react' import React from 'react'
import App from '../App'
import { useTable, useFilters, useGlobalFilter, useSortBy, usePagination } from 'react-table' import { useTable, useFilters, useGlobalFilter, useSortBy, usePagination } from 'react-table'
import APIClient from '../api/APIClient' import APIClient from '../api/APIClient'
import { useQuery } from 'react-query' import { useQuery } from 'react-query'
@ -699,5 +698,3 @@ function DataTablee() {
</div> </div>
) )
} }
export default App;

View file

@ -160,7 +160,7 @@ function FilterListItem({ filter, idx }: FilterListItemProps) {
</Link> </Link>
</td> </td>
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{filter.indexers && filter.indexers.map(t => <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{filter.indexers && filter.indexers.map(t =>
<span key={t.id} className="mr-2 inline-flex items-center px-2.5 py-0.5 rounded-md text-sm font-medium bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-400">{t.name}</span>)}</td> <span key={t.id} className="mr-2 inline-flex items-center px-2.5 py-0.5 rounded-md text-sm font-medium bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-400">{t.name}</span>)}</td>
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> <td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<Link to={`filters/${filter.id.toString()}`} className="text-indigo-600 dark:text-gray-200 hover:text-indigo-900 dark:hover:text-gray-400"> <Link to={`filters/${filter.id.toString()}`} className="text-indigo-600 dark:text-gray-200 hover:text-indigo-900 dark:hover:text-gray-400">
Edit Edit

View file

@ -1,32 +1,30 @@
const colors = require('tailwindcss/colors') const colors = require('tailwindcss/colors')
module.exports = { module.exports = {
purge: { content: [
content: [ './src/**/*.{tsx,ts,html,css}',
'./src/**/*.{tsx,ts,html,css}', ],
], safelist: [
safelist: [ 'col-span-1',
'col-span-1', 'col-span-2',
'col-span-2', 'col-span-3',
'col-span-3', 'col-span-4',
'col-span-4', 'col-span-5',
'col-span-5', 'col-span-6',
'col-span-6', 'col-span-7',
'col-span-7', 'col-span-8',
'col-span-8', 'col-span-9',
'col-span-9', 'col-span-10',
'col-span-10', 'col-span-11',
'col-span-11', 'col-span-12',
'col-span-12', ],
], // purge: false,
},
darkMode: 'class', // or 'media' or 'class' darkMode: 'class', // or 'media' or 'class'
theme: { theme: {
extend: { extend: {
colors: { colors: {
gray: colors.gray, gray: colors.zinc,
teal: colors.teal, },
}
}, },
}, },
variants: { variants: {

File diff suppressed because it is too large Load diff