Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean unused split on params & remove undefined type on general params recos #114

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/components/layout/ByteSimHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function BytesimeHeader() {
const dispatch = useDispatch();
const navigate = useNavigate();
const { search } = useLocation();
const imageParams = search.split("&")[0];
return (
<Flex
align="center"
Expand Down Expand Up @@ -52,7 +51,6 @@ export default function BytesimeHeader() {
<ButtonWithIconCustom
icon={<></>}
label={"Best practices"}
//subLabel={"Start with ByteSim"}
variant={"ghost"}
iconAfter
onClick={() => navigate(`./best-practices${search}`)}
Expand Down
3 changes: 1 addition & 2 deletions src/components/recommandations/BestPracticesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { BPTooltipContent } from "./Recommandation";
export default function BestPracticesPage() {
const navigate = useNavigate();
const { search } = useLocation();
const imageParams = search.split("&")[0];
return (
<>
<Flex direction="column" p={6}>
Expand All @@ -31,7 +30,7 @@ export default function BestPracticesPage() {
<Button
variant="outline"
colorScheme={"brand"}
onClick={() => navigate(`/figma${imageParams}`)}
onClick={() => navigate(`/figma${search}`)}
alignSelf="flex-start"
size={"sm"}
>
Expand Down
3 changes: 1 addition & 2 deletions src/components/recommandations/ExportButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useLocation, useNavigate } from "react-router-dom";

export default function ExportButton() {
const { search } = useLocation(); // keep image params
const imageParams = search.split("&")[0];
const navigate = useNavigate();
return (
<>
Expand All @@ -12,7 +11,7 @@ export default function ExportButton() {
alignSelf={"center"}
justifySelf={"flex-end"}
onClick={() => {
navigate(`/export${imageParams}`); // keep url params
navigate(`/export${search}`); // keep url params
}}
size="sm"
minWidth="min-content"
Expand Down
4 changes: 3 additions & 1 deletion src/components/recommandations/RecommandationsByZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export default function RecommandationsByZone({
? "General Parameters"
: zoneRecommandations[0].zoneName}
</Text>
<Text as="span">{" - " + zone?.zoneType ?? "–"}</Text>
<Text as="span" hidden={zone?.zoneType === undefined}>
{" - " + zone?.zoneType ?? "–"}
</Text>
</Text>
<Text fontSize={"xs"}></Text>
{zone?.zoneType ? (
Expand Down
5 changes: 0 additions & 5 deletions src/components/recommandations/ReloadRecoButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import { ReactComponent as ResetIcon } from "../../assets/ResetIcon_Active_MouseOver.svg";
import { recommandationsPopulated } from "../../features/recommandations/recommandationsSlice";
import { colorTheme } from "../../theme";
//import { useNavigate } from "react-router-dom";

export default function ReloadRecoButton() {
const dispatch = useDispatch();
Expand All @@ -18,10 +17,6 @@ export default function ReloadRecoButton() {
const reloadSimulation = React.useCallback(() => {
dispatch(recommandationsPopulated([...recosGeneric, ...recos]));
}, [dispatch, recos]);
//const currentDisplayedRecos = useAppSelector((state) => state.recommandations);
/* const newRecos = React.useEffect(() => {
if (recos.length !== currentDisplayedRecos.length) { return true }
}, [recos, currentDisplayedRecos]); */

return (
<>
Expand Down
1 change: 0 additions & 1 deletion src/features/figma/components/FetchedSVG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const FetchedSVG = ({
setTimeout(() => {
dispatch(zonesSetTree([newTree]));
dispatch(zonesFilterByElementId(newZones));

const newParams = search
?.replace("&new=true", "")
.replace("new=true", "");
Expand Down