diff --git a/.prettierrc b/.prettierrc index 3188523..952565c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { - "singleQuote": true, - "semi": false, - "trailingComma": "es5", - "printWidth": 120 -} \ No newline at end of file + "singleQuote": true, + "semi": false, + "trailingComma": "es5", + "printWidth": 120 +} diff --git a/eslint.config.js b/eslint.config.js index 092408a..91d3441 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -19,10 +19,7 @@ export default tseslint.config( }, rules: { ...reactHooks.configs.recommended.rules, - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], + 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], }, - }, + } ) diff --git a/index.html b/index.html index c4ca820..776505a 100644 --- a/index.html +++ b/index.html @@ -2,10 +2,13 @@ - - - - + + + + Suspicios Vessel Finder diff --git a/package-lock.json b/package-lock.json index 6ddd480..8897d71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "leaflet": "^1.9.4", "leaflet-pixi-overlay": "^1.9.4", "pixi.js": "^7.4.2", + "prettier": "^3.3.3", "react": "^18.3.1", "react-dom": "^18.3.1", "react-leaflet": "^4.2.1", @@ -4346,6 +4347,20 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", diff --git a/package.json b/package.json index 538df47..6dabece 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dev:all": "concurrently \"npm run proxy\" \"npm run dev\"", "build": "tsc -b && vite build", "lint": "eslint .", + "format": "prettier --write src", "preview": "vite preview", "build:protos:mac": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=outputClientImpl=grpc-web --ts_proto_out=./proto ./AIS-protobuf/ais.proto", "build:protos:win": "protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto.cmd --ts_proto_opt=outputClientImpl=grpc-web --ts_proto_out=./proto ./AIS-protobuf/ais.proto", @@ -22,6 +23,7 @@ "leaflet": "^1.9.4", "leaflet-pixi-overlay": "^1.9.4", "pixi.js": "^7.4.2", + "prettier": "^3.3.3", "react": "^18.3.1", "react-dom": "^18.3.1", "react-leaflet": "^4.2.1", @@ -48,4 +50,4 @@ "typescript-eslint": "^8.0.1", "vite": "^5.4.1" } -} +} \ No newline at end of file diff --git a/src/components/monitoringMenu.tsx b/src/components/monitoringMenu.tsx index 3dbcb7a..9f67a55 100644 --- a/src/components/monitoringMenu.tsx +++ b/src/components/monitoringMenu.tsx @@ -15,7 +15,9 @@ export default function MonitoringMenu({ monitoredVessels, children }: IMonitori

Monitored vessels

-

{monitoredVessels.length} {monitoredVessels.length == 1 ? "vessel" : "vessels"}

+

+ {monitoredVessels.length} {monitoredVessels.length == 1 ? 'vessel' : 'vessels'} +

{!isCollapsed && ( <> @@ -34,12 +36,12 @@ export default function MonitoringMenu({ monitoredVessels, children }: IMonitori
)} - ) diff --git a/src/components/monitoringMenuRow.tsx b/src/components/monitoringMenuRow.tsx index a921ae5..71d29e1 100644 --- a/src/components/monitoringMenuRow.tsx +++ b/src/components/monitoringMenuRow.tsx @@ -17,9 +17,15 @@ export default function MonitoringMenuRow({ isSelected, monitoredVessel, zoomToC return (

{monitoredVessel.mmsi}

-

{(Math.round(monitoredVessel.trustworthiness*1000)/10).toFixed(2)}%

-

{monitoredVessel.reason}

-
diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 18cc0ab..922320c 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -1,60 +1,77 @@ -import { useState } from "react" -import { useAppContext } from "../contexts/appcontext" -import FaviconSVG from "../svgs/faviconSVG" -import HamburgerSVG from "../svgs/hamburgerSVG" -import CloseSVG from "../svgs/closeSVG" +import { useState } from 'react' +import { useAppContext } from '../contexts/appcontext' +import FaviconSVG from '../svgs/faviconSVG' +import HamburgerSVG from '../svgs/hamburgerSVG' +import CloseSVG from '../svgs/closeSVG' -interface INavbar { +interface INavbar {} -} - -export default function Navbar({ }: INavbar) { - const [opened, setOpened] = useState(false) - const { myDateTime, myClockSpeed, setMyDateTime, setMyClockSpeed } = useAppContext() - const convertedMyDateTime = `${myDateTime.getFullYear()}-${myDateTime.getMonth().toString().padStart(2, "0")}-${myDateTime.getDate().toString().padStart(2, "0")}T${myDateTime.getHours().toString().padStart(2, "0")}:${myDateTime.getMinutes().toString().padStart(2, "0")}` +export default function Navbar({}: INavbar) { + const [opened, setOpened] = useState(false) + const { myDateTime, myClockSpeed, setMyDateTime, setMyClockSpeed } = useAppContext() + const convertedMyDateTime = `${myDateTime.getFullYear()}-${myDateTime.getMonth().toString().padStart(2, '0')}-${myDateTime.getDate().toString().padStart(2, '0')}T${myDateTime.getHours().toString().padStart(2, '0')}:${myDateTime.getMinutes().toString().padStart(2, '0')}` - function manageSpeedChange(val: string) { - try { - const parsed = parseInt(val) - setMyClockSpeed(parsed) - } catch (e) { - console.error(e) - setMyClockSpeed(1) - } + function manageSpeedChange(val: string) { + try { + const parsed = parseInt(val) + setMyClockSpeed(parsed) + } catch (e) { + console.error(e) + setMyClockSpeed(1) } + } - function manageDateChange(val: string) { - const parsed = new Date(val) - setMyDateTime(parsed) - } + function manageDateChange(val: string) { + const parsed = new Date(val) + setMyDateTime(parsed) + } - return ( -
- + ) +} diff --git a/src/components/path.tsx b/src/components/path.tsx index d8eb623..9b65f3e 100644 --- a/src/components/path.tsx +++ b/src/components/path.tsx @@ -1,34 +1,34 @@ -import { useEffect } from 'react'; -import { useVesselGuiContext } from '../contexts/vesselGuiContext'; -import { ILocation } from '../models/location'; -import L from "leaflet" +import { useEffect } from 'react' +import { useVesselGuiContext } from '../contexts/vesselGuiContext' +import { ILocation } from '../models/location' +import L from 'leaflet' interface IPathProps { - path: ILocation[]; + path: ILocation[] map: L.Map } export default function Path({ path, map }: IPathProps) { useEffect(() => { - const points = path.map(loc => L.latLng(loc.point.lat, loc.point.lon)) + const points = path.map((loc) => L.latLng(loc.point.lat, loc.point.lon)) const polyline = new L.Polyline(points, { color: 'red', weight: 3, opacity: 0.5, - smoothFactor: 1 - }); - - polyline.addTo(map); - + smoothFactor: 1, + }) + + polyline.addTo(map) + return () => { - map.eachLayer(layer => { - if(layer instanceof L.Polyline) { + map.eachLayer((layer) => { + if (layer instanceof L.Polyline) { map.removeLayer(layer) } - }) + }) } }, [path]) - return null + return null } diff --git a/src/components/timeline.tsx b/src/components/timeline.tsx index 5793050..4ebe591 100644 --- a/src/components/timeline.tsx +++ b/src/components/timeline.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from 'react' import { useVesselGuiContext } from '../contexts/vesselGuiContext' interface ITimelineProps { - timestamps: Date[]; - onChange(index: number): void; + timestamps: Date[] + onChange(index: number): void } export default function Timeline({ timestamps, onChange }: ITimelineProps) { @@ -29,11 +29,15 @@ export default function Timeline({ timestamps, onChange }: ITimelineProps) {

- Timestamp: {timelineVal && timestamps[timelineVal] ? timestamps[timelineVal].toISOString().replace("T", " ").replace("Z", "").slice(0, 19) : "unknown"} + Timestamp:{' '} + {timelineVal && timestamps[timelineVal] + ? timestamps[timelineVal].toISOString().replace('T', ' ').replace('Z', '').slice(0, 19) + : 'unknown'}

diff --git a/src/contexts/appcontext.tsx b/src/contexts/appcontext.tsx index 7dc2293..39963c3 100644 --- a/src/contexts/appcontext.tsx +++ b/src/contexts/appcontext.tsx @@ -1,53 +1,55 @@ -import { createContext, RefObject, useContext, useEffect, useRef, useState } from 'react'; -import { IClientHandler } from '../interfaces/IClientHandler'; -import { AISServiceClientImpl, GrpcWebImpl } from '../../proto/AIS-protobuf/ais'; -import GRPCClientHandler from '../implementations/GRPCClientHandler'; +import { createContext, RefObject, useContext, useEffect, useRef, useState } from 'react' +import { IClientHandler } from '../interfaces/IClientHandler' +import { AISServiceClientImpl, GrpcWebImpl } from '../../proto/AIS-protobuf/ais' +import GRPCClientHandler from '../implementations/GRPCClientHandler' interface IAppContext { - myDateTime: Date; - myDateTimeRef: RefObject; - setMyDateTime: React.Dispatch>; - myClockSpeed: number; - setMyClockSpeed: React.Dispatch>; - clientHandler: IClientHandler; + myDateTime: Date + myDateTimeRef: RefObject + setMyDateTime: React.Dispatch> + myClockSpeed: number + setMyClockSpeed: React.Dispatch> + clientHandler: IClientHandler } -const AppContext = createContext(undefined); +const AppContext = createContext(undefined) export const useAppContext = () => { - const context = useContext(AppContext); + const context = useContext(AppContext) if (context === undefined) { - throw new Error('useAppContext must be used within an AppContextProvider'); + throw new Error('useAppContext must be used within an AppContextProvider') } - return context; -}; + return context +} export const AppContextProvider = ({ children }: { children: React.ReactNode }) => { - const [myDateTime, setMyDateTime] = useState(new Date(1725844950 * 1000)); // Initialized with current time - const [myClockSpeed, setMyClockSpeed] = useState(100); - const myDateTimeRef = useRef(new Date(1725844950 * 1000)); // Initialize ref with current time + const [myDateTime, setMyDateTime] = useState(new Date(1725844950 * 1000)) // Initialized with current time + const [myClockSpeed, setMyClockSpeed] = useState(100) + const myDateTimeRef = useRef(new Date(1725844950 * 1000)) // Initialize ref with current time - const grpcWeb = new GrpcWebImpl('http://localhost:8080', {}); - const client = new AISServiceClientImpl(grpcWeb); - const clientHandler = new GRPCClientHandler(client); + const grpcWeb = new GrpcWebImpl('http://localhost:8080', {}) + const client = new AISServiceClientImpl(grpcWeb) + const clientHandler = new GRPCClientHandler(client) // Manage "fake" global clock useEffect(() => { const manageTimeChange = () => { - setMyDateTime((prevDateTime) => new Date(prevDateTime.getTime() + myClockSpeed * 1000)); - myDateTimeRef.current = new Date(myDateTimeRef.current.getTime() + myClockSpeed * 1000); - }; + setMyDateTime((prevDateTime) => new Date(prevDateTime.getTime() + myClockSpeed * 1000)) + myDateTimeRef.current = new Date(myDateTimeRef.current.getTime() + myClockSpeed * 1000) + } - const interval = setInterval(manageTimeChange, 1000); + const interval = setInterval(manageTimeChange, 1000) - return () => clearInterval(interval); // Clean up the interval on unmount - }, [myClockSpeed]); // Re-run the effect if myClockSpeed changes + return () => clearInterval(interval) // Clean up the interval on unmount + }, [myClockSpeed]) // Re-run the effect if myClockSpeed changes return ( - + {children} - ); -}; + ) +} -export default AppContext; +export default AppContext diff --git a/src/contexts/vesselGuiContext.tsx b/src/contexts/vesselGuiContext.tsx index 503a904..8a52d67 100644 --- a/src/contexts/vesselGuiContext.tsx +++ b/src/contexts/vesselGuiContext.tsx @@ -60,10 +60,10 @@ export const VesselGuiContextProvider = ({ children }: { children: React.ReactNo setActiveTime, selectionArea, setSelectionArea, - selectedVesselmmsi, + selectedVesselmmsi, setSelectedVesselmmsi, - selectedVesselPath, - setSelectedVesselPath + selectedVesselPath, + setSelectedVesselPath, }} > {children} diff --git a/src/implementations/GRPCClientHandler.ts b/src/implementations/GRPCClientHandler.ts index da05c0a..4f03d01 100644 --- a/src/implementations/GRPCClientHandler.ts +++ b/src/implementations/GRPCClientHandler.ts @@ -102,20 +102,24 @@ export default class GRPCClientHandler implements IClientHandler { } } - private convertToVesselPath(grpcVesselPath: VesselPathResponse): IVesselPath{ + private convertToVesselPath(grpcVesselPath: VesselPathResponse): IVesselPath { return { mmsi: grpcVesselPath.mmsi, pathForecast: { - locations: [] + locations: [], // grpcVesselPath.pathForecast!.locations.map((loc) => { // return { point: { lon: loc.point!.lon, lat: loc.point!.lat }, heading: loc.heading, timestamp: new Date(loc.timestamp) } // }) }, pathHistory: { locations: grpcVesselPath.pathHistory!.locations.map((loc) => { - return { point: { lon: loc.point!.lon, lat: loc.point!.lat }, heading: loc.heading, timestamp: new Date(loc.timestamp) } - }) - } + return { + point: { lon: loc.point!.lon, lat: loc.point!.lat }, + heading: loc.heading, + timestamp: new Date(loc.timestamp), + } + }), + }, } } diff --git a/src/implementations/GraphicOverlayHandler.ts b/src/implementations/GraphicOverlayHandler.ts index 7c4724d..3d6572c 100644 --- a/src/implementations/GraphicOverlayHandler.ts +++ b/src/implementations/GraphicOverlayHandler.ts @@ -8,7 +8,10 @@ export default class GraphicOverlayHandler implements IMapOverlay { private readonly overlay: L.LeafletPixiOverlayDefnition private isGraphicsUpdated = true - constructor(private readonly pixiContainer: PIXI.Container, private readonly graphicOptions: IGraphicOptions[]) { + constructor( + private readonly pixiContainer: PIXI.Container, + private readonly graphicOptions: IGraphicOptions[] + ) { this.overlay = L.pixiOverlay(this.getDrawCallback(), pixiContainer, { doubleBuffering: true, autoPreventDefault: false, diff --git a/src/implementations/SpriteMarkerOverlayHandler.ts b/src/implementations/SpriteMarkerOverlayHandler.ts index 269ce14..5ed2dc4 100644 --- a/src/implementations/SpriteMarkerOverlayHandler.ts +++ b/src/implementations/SpriteMarkerOverlayHandler.ts @@ -8,7 +8,10 @@ export default class SpriteMarkerOverlayHandler implements IMapOverlay { private readonly overlay: L.LeafletPixiOverlayDefnition private isMarkersUpdated = true - constructor(private readonly markerOptions: ISpriteMarkerOptions[], private readonly pixiContainer: PIXI.Container) { + constructor( + private readonly markerOptions: ISpriteMarkerOptions[], + private readonly pixiContainer: PIXI.Container + ) { this.overlay = L.pixiOverlay(this.getDrawCallback(), pixiContainer, { doubleBuffering: true, autoPreventDefault: false, diff --git a/src/index.css b/src/index.css index 0fd44d4..660a6b8 100644 --- a/src/index.css +++ b/src/index.css @@ -3,9 +3,8 @@ @tailwind utilities; body { - font-family: -apple-system, BlinkMacSystemFont, 'Gabarito', 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Gabarito', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', + 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } diff --git a/src/interfaces/IClientHandler.ts b/src/interfaces/IClientHandler.ts index 538a7dd..4fa5417 100644 --- a/src/interfaces/IClientHandler.ts +++ b/src/interfaces/IClientHandler.ts @@ -13,7 +13,7 @@ export interface IClientHandler { getVesselInfo(request: { mmsi: number; timestamp: number }): Promise getSimpleVessles(request: { timestamp: number }): Promise getMonitoredVessels(request: { timestamp: number; selection: ISelectionArea }): Promise - getVesselPath(request: {mmsi: number, starttime: number, endtime: number}): Promise + getVesselPath(request: { mmsi: number; starttime: number; endtime: number }): Promise //Deprecated cant close stream startStreaming(request: { diff --git a/src/models/location.ts b/src/models/location.ts index b1b84e8..bc06d21 100644 --- a/src/models/location.ts +++ b/src/models/location.ts @@ -7,5 +7,9 @@ export interface ILocation { } export default class Location implements ILocation { - constructor(public point: IPoint, public heading: number, public timestamp: Date) {} + constructor( + public point: IPoint, + public heading: number, + public timestamp: Date + ) {} } diff --git a/src/models/monitoredVessel.ts b/src/models/monitoredVessel.ts index 9fe9662..5b72f43 100644 --- a/src/models/monitoredVessel.ts +++ b/src/models/monitoredVessel.ts @@ -5,5 +5,9 @@ export interface IMonitoredVessel { } export default class MonitoredVessel implements IMonitoredVessel { - constructor(public mmsi: number, public trustworthiness: number, public reason?: string) { } + constructor( + public mmsi: number, + public trustworthiness: number, + public reason?: string + ) {} } diff --git a/src/models/point.ts b/src/models/point.ts index 1d1684c..aff8c68 100644 --- a/src/models/point.ts +++ b/src/models/point.ts @@ -1,8 +1,11 @@ export interface IPoint { - lat: number; - lon: number; + lat: number + lon: number } export default class Point implements IPoint { - constructor(public lat: number, public lon: number) { } -} \ No newline at end of file + constructor( + public lat: number, + public lon: number + ) {} +} diff --git a/src/models/selectionArea.ts b/src/models/selectionArea.ts index 5ba4143..298396b 100644 --- a/src/models/selectionArea.ts +++ b/src/models/selectionArea.ts @@ -1,9 +1,9 @@ import { IPoint } from './point' export interface ISelectionArea { - points: IPoint[]; + points: IPoint[] } export default class SelectionArea implements ISelectionArea { - constructor(public points: IPoint[]) { } -} \ No newline at end of file + constructor(public points: IPoint[]) {} +} diff --git a/src/models/simpleVessel.ts b/src/models/simpleVessel.ts index 95131b1..9ae6e19 100644 --- a/src/models/simpleVessel.ts +++ b/src/models/simpleVessel.ts @@ -7,5 +7,9 @@ export interface ISimpleVessel { } export default class SimpleVessel implements ISimpleVessel { - constructor(public location: ILocation, public mmsi: number, public heading?: number) {} + constructor( + public location: ILocation, + public mmsi: number, + public heading?: number + ) {} } diff --git a/src/models/vesselPath.ts b/src/models/vesselPath.ts index 4efb9ed..bca5906 100644 --- a/src/models/vesselPath.ts +++ b/src/models/vesselPath.ts @@ -1,7 +1,7 @@ import { ILocation } from './location' interface IPath { - locations: ILocation[] + locations: ILocation[] } export interface IVesselPath { @@ -11,5 +11,9 @@ export interface IVesselPath { } export default class VesselPath implements IVesselPath { - constructor(public mmsi: number, public pathForecast: IPath, public pathHistory: IPath) {} + constructor( + public mmsi: number, + public pathForecast: IPath, + public pathHistory: IPath + ) {} } diff --git a/src/svgs/chevronSVG.tsx b/src/svgs/chevronSVG.tsx index 3d6134d..395bfc5 100644 --- a/src/svgs/chevronSVG.tsx +++ b/src/svgs/chevronSVG.tsx @@ -1,23 +1,26 @@ interface IChevronProps { - width?:number + width?: number height?: number rotate?: number } -export default function ChevronSVG({width, height, rotate }: IChevronProps) { +export default function ChevronSVG({ width, height, rotate }: IChevronProps) { width = width ? width : 24 height = height ? height : 24 - + return ( - - + xmlns="http://www.w3.org/2000/svg" + width={width} + height={height} + fill="currentColor" + className={'bi bi-chevron-down' + (rotate ? ' rotate-' + rotate : '')} + viewBox="0 0 16 16" + > + + ) } diff --git a/src/svgs/clearSVG.tsx b/src/svgs/clearSVG.tsx index 26bd8fe..6d7c1f8 100644 --- a/src/svgs/clearSVG.tsx +++ b/src/svgs/clearSVG.tsx @@ -1,22 +1,22 @@ interface IClearProps { - width?:number + width?: number height?: number } -export default function ClearSVG({width, height }: IClearProps) { +export default function ClearSVG({ width, height }: IClearProps) { width = width ? width : 32 height = height ? height : 32 - + return ( - - + xmlns="http://www.w3.org/2000/svg" + width={width} + height={height} + fill="currentColor" + className="bi bi-eraser" + viewBox="0 0 16 16" + > + + ) } diff --git a/src/svgs/closeSVG.tsx b/src/svgs/closeSVG.tsx index 79cacd2..765dcdf 100644 --- a/src/svgs/closeSVG.tsx +++ b/src/svgs/closeSVG.tsx @@ -1,15 +1,15 @@ interface ICloseProps { - width?:number + width?: number height?: number } -export default function CloseSVG({width, height }: ICloseProps) { +export default function CloseSVG({ width, height }: ICloseProps) { width = width ? width : 25 height = height ? height : 25 - + return ( - + ) } diff --git a/src/svgs/eyeSVG.tsx b/src/svgs/eyeSVG.tsx index cc9a5b5..3c7e101 100644 --- a/src/svgs/eyeSVG.tsx +++ b/src/svgs/eyeSVG.tsx @@ -1,23 +1,23 @@ interface IEyeProps { - width?:number + width?: number height?: number } -export default function EyeSVG({width, height }: IEyeProps) { +export default function EyeSVG({ width, height }: IEyeProps) { width = width ? width : 20 height = height ? height : 20 - + return ( - - - + xmlns="http://www.w3.org/2000/svg" + width={width} + height={height} + fill="currentColor" + className="bi bi-eye" + viewBox="0 0 16 16" + > + + + ) } diff --git a/src/svgs/faviconSVG.tsx b/src/svgs/faviconSVG.tsx index 7d0daa9..9cd7b90 100644 --- a/src/svgs/faviconSVG.tsx +++ b/src/svgs/faviconSVG.tsx @@ -1,22 +1,25 @@ interface IFaviconProps { - width?:number + width?: number height?: number } -export default function FaviconSVG({width, height }: IFaviconProps) { +export default function FaviconSVG({ width, height }: IFaviconProps) { width = width ? width : 30 height = height ? height : 30 - + return ( - - - + + + - - + + - + ) } diff --git a/src/svgs/hamburgerSVG.tsx b/src/svgs/hamburgerSVG.tsx index b4850bc..fabed8d 100644 --- a/src/svgs/hamburgerSVG.tsx +++ b/src/svgs/hamburgerSVG.tsx @@ -1,15 +1,15 @@ interface IHamburgerProps { - width?:number + width?: number height?: number } -export default function HamburgerSVG({width, height }: IHamburgerProps) { +export default function HamburgerSVG({ width, height }: IHamburgerProps) { width = width ? width : 25 height = height ? height : 25 - + return ( - + ) } diff --git a/src/svgs/infoSVG.tsx b/src/svgs/infoSVG.tsx index 518d904..0c9f56c 100644 --- a/src/svgs/infoSVG.tsx +++ b/src/svgs/infoSVG.tsx @@ -1,15 +1,15 @@ interface IInfoProps { - width?:number + width?: number height?: number } -export default function InfoSVG({width, height}: IInfoProps) { +export default function InfoSVG({ width, height }: IInfoProps) { width = width ? width : 24 height = height ? height : 24 - + return ( - - + + ) } diff --git a/src/svgs/polygonSVG.tsx b/src/svgs/polygonSVG.tsx index 344cfc5..8dd1f70 100644 --- a/src/svgs/polygonSVG.tsx +++ b/src/svgs/polygonSVG.tsx @@ -1,22 +1,22 @@ interface IPolygonProps { - width?:number + width?: number height?: number } -export default function PolygonSVG({width, height }: IPolygonProps) { +export default function PolygonSVG({ width, height }: IPolygonProps) { width = width ? width : 32 height = height ? height : 32 - + return ( - - + xmlns="http://www.w3.org/2000/svg" + width={width} + height={height} + fill="currentColor" + className="bi bi-heptagon" + viewBox="0 0 16 16" + > + + ) } diff --git a/src/svgs/rectangleSVG.tsx b/src/svgs/rectangleSVG.tsx index 8b29860..0f80891 100644 --- a/src/svgs/rectangleSVG.tsx +++ b/src/svgs/rectangleSVG.tsx @@ -1,22 +1,22 @@ interface IRectangleProps { - width?:number + width?: number height?: number } -export default function RectangleSVG({width, height }: IRectangleProps) { +export default function RectangleSVG({ width, height }: IRectangleProps) { width = width ? width : 32 height = height ? height : 32 - + return ( - - + xmlns="http://www.w3.org/2000/svg" + width={width} + height={height} + fill="currentColor" + className="bi bi-square" + viewBox="0 0 16 16" + > + + ) } diff --git a/tailwind.config.js b/tailwind.config.js index 04923cc..891c3d9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -4,14 +4,14 @@ export default { theme: { extend: { colors: { - primary: "#f97316", - secondary: "#ca8a04", - neutral_1: "#f1f5f9", - neutral_2: "#cbd5e1", - neutral_3: "#64748b", - neutral_4: "#334155", - neutral_5: "#1e293b" - } + primary: '#f97316', + secondary: '#ca8a04', + neutral_1: '#f1f5f9', + neutral_2: '#cbd5e1', + neutral_3: '#64748b', + neutral_4: '#334155', + neutral_5: '#1e293b', + }, }, }, plugins: [], diff --git a/tsconfig.json b/tsconfig.json index 1ffef60..d32ff68 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,4 @@ { "files": [], - "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } - ] + "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }] }