Skip to content

Commit

Permalink
Merge pull request #1778 from AletheiaFact/Migrate-kanban-and-homehea…
Browse files Browse the repository at this point in the history
…der-page-to-mui-material

Migrate kanban and home header page to mui material
  • Loading branch information
thesocialdev authored Jan 18, 2025
2 parents e59e3fa + 02b9945 commit 0513d1e
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/components/Home/HomeHeader/HomeHeader.style.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import styled from "styled-components";
import { queries } from "../../../styles/mediaQueries";
import colors from "../../../styles/colors";
import { Col } from "antd";
import Grid from "@mui/material/Grid";

const HomeHeaderStyle = styled(Col)`
const HomeHeaderStyle = styled(Grid)`
display: flex;
background-color: ${colors.blackTertiary};
align-items: center;
Expand Down
16 changes: 8 additions & 8 deletions src/components/Home/HomeHeader/HomeHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Col } from "antd";
import Grid from "@mui/material/Grid";
import React from "react";
import CTASection from "../CTA/CTASection";
import HomeHeaderStyle from "./HomeHeader.style";
Expand All @@ -8,17 +8,17 @@ import HomeHeaderSearch from "./HomeHeaderSearch";

const HomeHeader = ({ stats }) => {
return (
<HomeHeaderStyle>
<Col
xxl={12}
lg={16}
sm={18}
xs={24}
<HomeHeaderStyle container>
<Grid item
xl={6}
lg={8}
sm={9}
xs={12}
className="home-header-content"
>
<HomeHeaderTitle />
<CTASection />
</Col>
</Grid>
<HomeStats stats={stats} />

<HomeHeaderSearch />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Home/HomeHeader/HomeHeaderSearch.style.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Col } from "antd";
import Grid from "@mui/material/Grid";
import styled from "styled-components";
import { queries } from "../../../styles/mediaQueries";
import colors from "../../../styles/colors";

const HomeHeaderSearchStyled = styled(Col)`
const HomeHeaderSearchStyled = styled(Grid)`
display: flex;
flex-direction: column;
justify-content: center;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/HomeHeader/HomeHeaderSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const HomeHeaderSearch = () => {
};

return (
<HomeHeaderSearchStyled xxl={12} lg={16} sm={18} xs={24}>
<HomeHeaderSearchStyled container item xl={6} lg={8} sm={9} xs={12}>
<h2 className="title">{t("home:homeHeaderSearchTitle")}</h2>

<InputSearch
Expand Down
6 changes: 3 additions & 3 deletions src/components/Home/HomeHeader/HomeHeaderTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import { Col } from "antd";
import Grid from "@mui/material/Grid";
import { useTranslation } from "next-i18next";

const HomeHeaderTitle = () => {
const { t } = useTranslation();
return (
<Col className="home-header-title">
<Grid item className="home-header-title">
<h1>{t("home:title")}</h1>
</Col>
</Grid>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Divider } from "antd";
import { Divider } from "@mui/material";
import { useTranslation } from "next-i18next";
import React from "react";

const EmptyKanbanCol = ({ title }) => {
const EmptyKanbanGrid = ({ title }) => {
const { t } = useTranslation();
return (
<div
Expand All @@ -16,9 +16,9 @@ const EmptyKanbanCol = ({ title }) => {
<span style={{ fontSize: 24 }}>{title}</span>

<span>{t("list:totalItems", { total: 0 })}</span>
<Divider style={{ marginTop: 12 }} />
<Divider flexItem variant="middle" style={{ marginTop: 12 }} />
</div>
);
};

export default EmptyKanbanCol;
export default EmptyKanbanGrid;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ReviewTaskStates } from "../../machines/reviewTask/enums";
import KanbanSkeleton from "../Skeleton/KanbanSkeleton";
import colors from "../../styles/colors";
import BaseList from "../List/BaseList";
import EmptyKanbanCol from "./EmptyKanbanCol";
import EmptyKanbanGrid from "./EmptyKanbanGrid";
import KanbanCard from "./KanbanCard";
import styled from "styled-components";

Expand All @@ -32,7 +32,7 @@ interface KanbanColProps {
};
}

const KanbanCol = ({
const KanbanGrid = ({
nameSpace,
state,
filterUser,
Expand All @@ -58,7 +58,7 @@ const KanbanCol = ({
/>
)}
emptyFallback={
<EmptyKanbanCol title={t(`reviewTask:${state}`)} />
<EmptyKanbanGrid title={t(`reviewTask:${state}`)} />
}
showDividers={false}
skeleton={<KanbanSkeleton />}
Expand All @@ -68,4 +68,4 @@ const KanbanCol = ({
);
};

export default KanbanCol;
export default KanbanGrid;
7 changes: 3 additions & 4 deletions src/components/Kanban/KanbanToolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Col } from "antd";
import React from "react";
import { useTranslation } from "next-i18next";

import { FormControlLabel, Switch } from "@mui/material";
import { FormControlLabel, Switch, Grid } from "@mui/material";

const KanbanToolbar = ({ filterUserTasks, setFilterUserTasks }) => {
const { t } = useTranslation();
Expand All @@ -18,7 +17,7 @@ const KanbanToolbar = ({ filterUserTasks, setFilterUserTasks }) => {
};

return (
<Col span={24} className="kanban-toolbar">
<Grid item xs={12} className="kanban-toolbar">
{Object.keys(filterUserTasks).map((task) => (
<FormControlLabel
key={task}
Expand All @@ -35,7 +34,7 @@ const KanbanToolbar = ({ filterUserTasks, setFilterUserTasks }) => {
)}
/>
))}
</Col>
</Grid>
);
};

Expand Down
12 changes: 6 additions & 6 deletions src/components/Kanban/KanbanView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Col } from "antd";
import React, { useMemo, useState } from "react";
import { Grid } from "@mui/material";
import React, { useState } from "react";

import {
KanbanClaimState,
Expand All @@ -8,7 +8,7 @@ import {
ReviewTaskStates,
ReviewTaskTypeEnum,
} from "../../machines/reviewTask/enums";
import KanbanCol from "./KanbanCol";
import KanbanGrid from "./KanbanGrid";
import { useAtom } from "jotai";
import { currentNameSpace } from "../../atoms/namespace";
import KanbanViewStyled from "./KanbanView.style";
Expand Down Expand Up @@ -36,17 +36,17 @@ const KanbanView = ({ reviewTaskType }) => {
filterUserTasks={filterUserTasks}
setFilterUserTasks={setFilterUserTasks}
/>
<Col span={23} className="kanban-board">
<Grid container item xs={11.5} justifyContent="center" className="kanban-board">
{states.map((state) => (
<KanbanCol
<KanbanGrid
key={state}
nameSpace={nameSpace}
state={ReviewTaskStates[state]}
filterUser={filterUserTasks}
reviewTaskType={reviewTaskType}
/>
))}
</Col>
</Grid>
</KanbanViewStyled>
);
};
Expand Down

0 comments on commit 0513d1e

Please sign in to comment.