Skip to content

Commit

Permalink
feat: setup gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
whflima committed Dec 8, 2024
1 parent df21a41 commit 0f5d02e
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 10 deletions.
120 changes: 120 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
},
"scripts": {
"start": "react-scripts start",
"predeploy" : "npm run build",
"deploy" : "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down Expand Up @@ -58,6 +60,7 @@
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"gh-pages": "^6.2.0",
"globals": "^15.13.0",
"prettier": "^3.4.2",
"typescript-eslint": "^8.17.0"
Expand Down
27 changes: 18 additions & 9 deletions src/components/simpleGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ import '@ag-grid-community/styles/ag-grid.css';
import '@ag-grid-community/styles/ag-theme-alpine.css';
import api from '../services/api';
import { User } from '../interfaces/interfaces';
import { Modal } from 'antd';
import { Button, FloatButton, Modal, Tooltip } from 'antd';
import ModalContent from './ModalContent';
import { EyeOutlined } from '@ant-design/icons';

const CustomButtonComponent = () => {
return (
<Button className="action-button" type="text" shape="circle" icon={<EyeOutlined />} />
);
};

export default function SimpleGrid() {
const [gridApi, setGridApi] = useState<any>();
Expand All @@ -24,26 +31,27 @@ export default function SimpleGrid() {
}, []);

const defaultColDef = {
flex: 1,
flex: 2,
resizable: true,
sortable: true,
filter: true
}

const colDefs: any[] = [
{ headerName: "Name", field: "name", filter: true },
{ headerName: "Username", field: "username", filter: true },
{ headerName: "Phone", field: "phone", filter: true },
{ headerName: "Email", field: "email", filter: true },
{ headerName: "Website", field: "website", filter: true },
{ headerName: "Actions", field: 'actions', cellRenderer: CustomButtonComponent, flex: 1, resizable: false, filter: false },
{ headerName: "Name", field: "name" },
{ headerName: "Username", field: "username" },
{ headerName: "Phone", field: "phone" },
{ headerName: "Email", field: "email" },
{ headerName: "Website", field: "website" },
];

const handleResize = (gridApi: any) => {

if (gridApi && gridApi.api) {
const sizeScreen = window.innerWidth;
const currentState = gridApi.api.getColumnState();
let columnSuported = Math.floor(sizeScreen / 280);
let columnSuported = Math.ceil(sizeScreen / 250);

currentState.forEach((colState: any) => {
if (columnSuported > 0) {
Expand All @@ -60,7 +68,8 @@ export default function SimpleGrid() {
setGridApi(params.api);

params.api.addGlobalListener((type: string, e: any) => {
if (type === "gridSizeChanged" || type === "columnResized") {
if (type === "dataTypesInferred" || type === "gridSizeChanged" || type === "columnResized") {
console.log(type);
handleResize(e);
}
});
Expand Down
67 changes: 66 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3193,7 +3193,7 @@ ast-types-flow@^0.0.8:
resolved "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz"
integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==

async@^3.2.3:
async@^3.2.3, async@^3.2.4:
version "3.2.6"
resolved "https://registry.npmjs.org/async/-/async-3.2.6.tgz"
integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==
Expand Down Expand Up @@ -3721,6 +3721,11 @@ combined-stream@^1.0.8:
dependencies:
delayed-stream "~1.0.0"

commander@^11.0.0:
version "11.1.0"
resolved "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz"
integrity sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==

commander@^2.20.0:
version "2.20.3"
resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz"
Expand Down Expand Up @@ -4450,6 +4455,11 @@ electron-to-chromium@^1.5.41:
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.70.tgz"
integrity sha512-P6FPqAWIZrC3sHDAwBitJBs7N7IF58m39XVny7DFseQXK2eiMn7nNQizFf63mWDDUnFvaqsM8FI0+ZZfLkdUGA==

email-addresses@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/email-addresses/-/email-addresses-5.0.0.tgz"
integrity sha512-4OIPYlA6JXqtVn8zpHpGiI7vE6EQOAg16aGnDMIAlZVinnoZ8208tW1hAbjWydgN/4PLTT9q+O1K6AH/vALJGw==

emittery@^0.10.2:
version "0.10.2"
resolved "https://registry.npmjs.org/emittery/-/emittery-0.10.2.tgz"
Expand Down Expand Up @@ -4664,6 +4674,11 @@ escape-html@~1.0.3:
resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz"
integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==

escape-string-regexp@^1.0.2:
version "1.0.5"
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==

escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
Expand Down Expand Up @@ -5244,6 +5259,20 @@ filelist@^1.0.4:
dependencies:
minimatch "^5.0.1"

filename-reserved-regex@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz"
integrity sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==

filenamify@^4.3.0:
version "4.3.0"
resolved "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz"
integrity sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==
dependencies:
filename-reserved-regex "^2.0.0"
strip-outer "^1.0.1"
trim-repeated "^1.0.0"

filesize@^8.0.6:
version "8.0.7"
resolved "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz"
Expand Down Expand Up @@ -5412,6 +5441,15 @@ fs-extra@^10.0.0:
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^11.1.1:
version "11.2.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz"
integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^9.0.0:
version "9.1.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz"
Expand Down Expand Up @@ -5514,6 +5552,19 @@ get-tsconfig@^4.7.5:
dependencies:
resolve-pkg-maps "^1.0.0"

gh-pages@^6.2.0:
version "6.2.0"
resolved "https://registry.npmjs.org/gh-pages/-/gh-pages-6.2.0.tgz"
integrity sha512-HMXJ8th9u5wRXaZCnLcs/d3oVvCHiZkaP5KQExQljYGwJjQbSPyTdHe/Gc1IvYUR/rWiZLxNobIqfoMHKTKjHQ==
dependencies:
async "^3.2.4"
commander "^11.0.0"
email-addresses "^5.0.0"
filenamify "^4.3.0"
find-cache-dir "^3.3.1"
fs-extra "^11.1.1"
globby "^11.1.0"

glob-parent@^5.1.2:
version "5.1.2"
resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz"
Expand Down Expand Up @@ -9947,6 +9998,13 @@ strip-json-comments@^3.1.1:
resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==

strip-outer@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz"
integrity sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==
dependencies:
escape-string-regexp "^1.0.2"

style-loader@^3.3.1:
version "3.3.4"
resolved "https://registry.npmjs.org/style-loader/-/style-loader-3.3.4.tgz"
Expand Down Expand Up @@ -10233,6 +10291,13 @@ tr46@^2.1.0:
dependencies:
punycode "^2.1.1"

trim-repeated@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz"
integrity sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==
dependencies:
escape-string-regexp "^1.0.2"

tryer@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz"
Expand Down

0 comments on commit 0f5d02e

Please sign in to comment.