Skip to content

Commit

Permalink
Update folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rajtoshranjan committed Apr 30, 2024
1 parent 9327248 commit db05258
Show file tree
Hide file tree
Showing 23 changed files with 21 additions and 21 deletions.
5 changes: 3 additions & 2 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
import { useEffect, useRef, useState } from "react";

import { GlobalContext } from "./contexts";
import { Header, SideNav } from "./components";
import { LayerPanel } from "./layer-panel";
import { Header } from "./header";

const baseStyleSpec: StyleSpecification = {
version: 8,
Expand Down Expand Up @@ -116,7 +117,7 @@ function App() {
return (
<GlobalContext.Provider value={{ map }}>
<Header />
<SideNav />
<LayerPanel />

{/* Map Container */}
<div
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from "classnames";
import React, { HTMLProps } from "react";
import IcoMoon from "react-icomoon";
import iconSet from "../../../assets/icons/selection.json";
import iconSet from "../../assets/icons/selection.json";
import { IconIdentifier } from "./constants";

export type IconProps = HTMLProps<SVGAElement> & {
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./header";
export * from "./sidenav";
export * from "./modal";
export * from "./button";
export * from "./icon";
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";

import classNames from "classnames";
import { Icon, IconIdentifier } from "../icon";
import { ModalBaseProps, ModalComponents, ModalProps } from "./type";
import { ModalComponents, ModalProps } from "./type";

export const Modal: React.FC<ModalProps> & ModalComponents = ({
title,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HTMLProps } from "react";
import { ForwardRef } from "../../../utils";
import { ForwardRef } from "../../utils";

export type ModalBaseProps = HTMLProps<HTMLDivElement>;

Expand Down
3 changes: 0 additions & 3 deletions src/components/ui/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/header/header.tsx → src/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Icon, IconIdentifier } from "../ui";
import { Icon, IconIdentifier } from "../components";
import { Search } from "./search";

export const Header = () => {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/header/search.tsx → src/header/search.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import classNames from "classnames";
import React, { ChangeEvent, useContext, useEffect, useState } from "react";
import { GlobalContext } from "../../contexts";
import { GlobalContext } from "../contexts";
import {
FeatureCollectionResponse,
FeatureResponse,
SelectedLocation,
} from "./types";

import { useDebounce } from "@uidotdev/usehooks";
import { Icon, IconIdentifier } from "../ui";
import { Icon, IconIdentifier } from "../components";

type SearchProps = React.HTMLProps<HTMLDivElement>;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IconIdentifier } from "../ui";
import { IconIdentifier } from "../../components";

export const MODES = {
select: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TerraDraw, TerraDrawMapLibreGLAdapter } from "terra-draw";
import { GlobalContext } from "../../contexts";

import classNames from "classnames";
import { Button, IconIdentifier } from "../ui";
import { Button, IconIdentifier } from "../../components";
import { MODES } from "./constants";
import { setupModes } from "./helpers";

Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions src/layer-panel/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./layer-panel";
10 changes: 5 additions & 5 deletions src/components/sidenav.tsx → src/layer-panel/layer-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { useLocalStorage } from "@uidotdev/usehooks";
import classNames from "classnames";
import { Draw } from "./draw";
import { Layer } from "./layer";
import { Icon, IconIdentifier } from "./ui";
import { Icon, IconIdentifier } from "../components";

export const SideNav = () => {
export const LayerPanel = () => {
// States.
const [show, setShow] = useLocalStorage<boolean>(
"isSideNavOpen",
"isLayerPanelOpen",
window.innerWidth >= 1024
);

Expand All @@ -21,7 +21,7 @@ export const SideNav = () => {
);

// Handlers.
const onClickToggleSideNav = () => {
const onClickToggleLayerPanel = () => {
setShow((prev) => !prev);
};

Expand All @@ -30,7 +30,7 @@ export const SideNav = () => {
{/* Toggle Button */}
<button
className="absolute flex ml-60 px-1 py-4 w-[1.4rem] top-2/4 -translate-y-2/4 bg-gray-900 text-gray-50 rounded-e-lg border-r border-t border-b border-gray-700"
onClick={onClickToggleSideNav}
onClick={onClickToggleLayerPanel}
>
<Icon
identifier={
Expand Down
2 changes: 1 addition & 1 deletion src/components/layer.tsx → src/layer-panel/layer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useToggle } from "@uidotdev/usehooks";
import { useContext } from "react";
import { GlobalContext } from "../contexts";
import { Icon, IconIdentifier } from "./ui";
import { Icon, IconIdentifier } from "../components";

export const Layer = () => {
// States.
Expand Down

0 comments on commit db05258

Please sign in to comment.