Skip to content

Commit

Permalink
Fix path imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik-Jay committed Jun 22, 2024
1 parent 9aca11e commit 9a2d7ed
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 29 deletions.
3 changes: 1 addition & 2 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { AuthProvider } from "./services/firebase/authProvider";
import { useGetWindowDimensionsHook } from "./utilities/useGetDdimensionsHook";
import logo from "./assets/images/logo/Mendisphere Logo colour.png";
import mendisphereTheme from "./theme";
import Routing from "./routing";
import { Paths } from "./routing/paths";
import Routing, { Paths } from "./routing";
import Header from "./components/header";
import Footer from "./components/footer";

Expand Down
2 changes: 1 addition & 1 deletion src/components/breadcrumbs/breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@chakra-ui/react";
import { HomeIcon } from "@primer/octicons-react";
import { Organisation } from "../../data/model/organisation";
import { Paths } from "../../routing/paths";
import { Paths } from "../../routing";

const currentPageStyle = {
color: "#3959FF",
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
} from "@chakra-ui/react";
import { Link as ReactRouterLink } from "react-router-dom";
import NavigationButton from "../navigationButton";
import { Paths } from "../../routing/paths";
import "../../pages/style.scss";

import logo from "../../assets/images/logo/Mendisphere Logo colour.png";
import { Paths } from "../../routing";

const Header = () => {
const [mobileNav, setMobileNav] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/organisationList/cardView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Grid, GridItem, LinkBox, LinkOverlay } from "@chakra-ui/react";
import { Organisation } from "../../data/model/organisation";
import { buildOrgProfilePath } from "../../routing/paths";
import OrgCard from "./organisationCard";
import { buildOrgProfilePath } from "../../routing";

const CardView: React.FC<{ organisationList: Organisation[] }> = ({
organisationList,
Expand Down
8 changes: 3 additions & 5 deletions src/pages/registration/profileSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import { useLocation, useNavigate } from "react-router-dom";
import { instanceOfLoginCredentials } from "../../data/auth/loginCredentials";
import OrgInfoForm from "./organisationInfoForm";
import GoalsForm from "./goalsForm";
import SignUpWaiting from "./signUpWaiting";
import "./setup.scss";
import { Paths } from "../../routing/paths";
import { IOrganisation } from "../../data/model/organisation";
import { IOrganisationAdminData } from "../../data/model/organisationAdmin";
import { IOrganisationSummary } from "../../data/model/organisationSummary";
import SignUpWaiting from "./signUpWaiting";
import { Paths } from "../../routing";

const steps = [
{ label: "Organisation Information" },
Expand All @@ -47,7 +47,7 @@ export interface OrgDataFormProps {
updateOrgFormData: (orgFormData: IOrgFormData) => void;
}

const ProfileSetup = () => {
export const ProfileSetup = () => {
const { nextStep, prevStep, activeStep, setStep } = useSteps({
initialStep: 1,
});
Expand Down Expand Up @@ -213,5 +213,3 @@ const ProfileSetup = () => {
</VStack>
);
};

export default ProfileSetup;
2 changes: 1 addition & 1 deletion src/pages/registration/registrationSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ArrowBackIcon } from "@chakra-ui/icons";
import { Container, Link, StackDivider, VStack } from "@chakra-ui/react";
import RegistrationMenuMessage from "./registrationMenuMessage";
import RegistrationForm from "./registrationForm";
import { Paths } from "../../routing/paths";
import { Paths } from "../../routing";

const RegistrationSection = () => {
return (
Expand Down
28 changes: 14 additions & 14 deletions src/pages/registration/signUpButton.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { Button } from "@chakra-ui/react";
import { useNavigate } from "react-router-dom";
import { Paths } from "../../routing/paths";
import { LoginCredentials } from "./signUpWaiting";
import { Paths } from "../../routing";

const SignUpButton = (LoginCredentials: LoginCredentials) => {
const disable: boolean = !LoginCredentials.validated;

const navigate = useNavigate();

return (
<Button
// disabled={disable}
width="full"
marginTop={4}
colorScheme="blue"
onClick={() => {
console.log(LoginCredentials);
navigate(Paths.profileSetup, { state: LoginCredentials });
}}
>
Sign Up
</Button>
<Button
// disabled={disable}
width="full"
marginTop={4}
colorScheme="blue"
onClick={() => {
console.log(LoginCredentials);
navigate(Paths.profileSetup, { state: LoginCredentials });
}}
>
Sign Up
</Button>
);
}
};

export default SignUpButton;
1 change: 1 addition & 0 deletions src/routing/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default } from "./routing";
export { Paths, buildOrgProfilePath } from "./paths";
File renamed without changes.
7 changes: 3 additions & 4 deletions src/routing/routing.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Route, Routes } from "react-router-dom";
import { Paths } from "./paths";
import OrganisationList from "../pages/organisationList";
import LoginPage from "../pages/login";
import UserDashboardPage from "../pages/userDashboard";
import Registration from "../pages/registration";
import ProfileSetupPage from "../pages/registration/profileSetup";
import OrgProfilePage from "../pages/organisationProfile";
import FirestoreMock from "../mocks/firestoreMock";
import Home from "../pages/home";
import Registration from "../pages/registration";
import { Paths } from ".";

const Routing = () => {
return (
Expand All @@ -16,7 +15,7 @@ const Routing = () => {
<Route path={Paths.login} element={<LoginPage />} />
<Route path={Paths.dashboard} element={<UserDashboardPage />} />
<Route path={Paths.signup} element={<Registration />} />
<Route path={Paths.profileSetup} element={<ProfileSetupPage />} />
{/* <Route path={Paths.profileSetup} element={<ProfileSetup />} /> */}
<Route path={Paths.organisationListing} element={<OrganisationList />} />
<Route path={Paths.organisationProfile} element={<OrgProfilePage />} />
{process.env.NODE_ENV === "development" && (
Expand Down

0 comments on commit 9a2d7ed

Please sign in to comment.