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

feat(catalogue): flexible design on scss #113

Merged
merged 3 commits into from
Aug 25, 2024
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
24 changes: 24 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"react-router-dom": "^6.25.1",
"react-scripts": "5.0.1",
"react-slideshow-image": "^4.3.1",
"sass": "^1.77.8",
"typescript": "^4.9.5",
"typescript-cookie": "^1.0.6",
"web-vitals": "^2.1.4"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion client/src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import "./App.css";
import "./App.scss";
import {
createBrowserRouter,
createRoutesFromElements,
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/catalogue/ui/Catalogue.page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useRef, useState } from "react";
import styles from "./styles/Catalogue.page.module.css";
import styles from "./styles/Catalogue.page.module.scss";
import { HeaderWidget } from "widgets/header";
import { FooterWidget } from "widgets/footer";
import { useLoaderData } from "react-router-dom";
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/catalogue/ui/SearchBarInput.field.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import styles from "./styles/SearchBarInput.field.module.css";
import styles from "./styles/SearchBarInput.field.module.scss";
import { InstrumentName } from "generated/model";
import { Filters } from "widgets/catalogue-filter";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./Catalogue.page.queries.module.css";
@use "shared/styles/vars" as vars;

.catalogue__wrapper {
display: flex;
Expand All @@ -20,3 +20,9 @@
display: flex;
flex-direction: column;
}

@media (max-width: vars.$media_threshold) {
.catalogue__filters__serp__navbar__wrapper {
flex-direction: column;
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@use "shared/styles/vars" as vars;

.search_bar__input {
font-size: 2em;
text-align: start;
border: 1px #dee2e6 solid;
}

@media (max-width: vars.$media_threshold) {
.search_bar__input {
font-size: 1.5em;
}
}
2 changes: 1 addition & 1 deletion client/src/pages/home/ui/Home.page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import styles from "./styles/Home.page.module.css";
import styles from "./styles/Home.page.module.scss";
import "react-slideshow-image/dist/styles.css";
import { HeaderWidget } from "widgets/header";
import { FooterWidget } from "widgets/footer";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "shared/styles/vars" as vars;

.home {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -64,7 +66,7 @@
margin: 0 15px;
}

@media (max-width: 570px) {
@media (max-width: vars.$media_threshold) {
.home {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.instrument_card {
width: 50%;
/*width: 50%;*/
display: flex;
flex-direction: column;
border: 1px #dee2e6 solid;
Expand Down
1 change: 1 addition & 0 deletions client/src/shared/styles/vars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$media_threshold: 570px;
26 changes: 15 additions & 11 deletions client/src/widgets/catalogue-filter/ui/SidebarFilter.widget.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import styles from "./styles/SidebarFilter.widget.module.css";
import styles from "./styles/SidebarFilter.widget.module.scss";
import { Filters } from "widgets/catalogue-filter";
import { Role } from "domain/model/role";
import Jwt from "domain/model/jwt";
Expand Down Expand Up @@ -67,11 +67,13 @@ export const SidebarFilterWidget = (props: Props) => {

return (
<div className={styles.filter_sidebar}>
<div className={styles.filter__wrapper}>
<InstrumentTypeFilter onValueChange={setInstrumentTypes} />
</div>
<div className={styles.filter__wrapper}>
<ManufacturerNameFilter onValueChange={setManufacturerNames} />
<div className={styles.filter__type_manufacturer__wrapper}>
<div className={styles.filter__wrapper}>
<InstrumentTypeFilter onValueChange={setInstrumentTypes} />
</div>
<div className={styles.filter__wrapper}>
<ManufacturerNameFilter onValueChange={setManufacturerNames} />
</div>
</div>

<div className={styles.filter__wrapper}>
Expand Down Expand Up @@ -108,12 +110,14 @@ export const SidebarFilterWidget = (props: Props) => {
</div>
</div>

<div className={styles.filter__wrapper}>
<CountryFilter onValueChange={setCountries} />
</div>
<div className={styles.filter__type_manufacturer__wrapper}>
<div className={styles.filter__wrapper}>
<CountryFilter onValueChange={setCountries} />
</div>

<div className={styles.filter__wrapper}>
<MaterialFilter onValueChange={setMaterials} />
<div className={styles.filter__wrapper}>
<MaterialFilter onValueChange={setMaterials} />
</div>
</div>

{Jwt.extractFromCookie()?.toRole() === Role.Editor && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
@use "shared/styles/vars" as vars;

.filter_sidebar {
padding: 0.2em;
background-color: #e0e0e0;
border: 1px #cccccc solid;
}

.filter__wrapper {
flex: 1;
margin-bottom: 0.5em;
}

Expand All @@ -15,3 +18,13 @@
.vertical__wrapper {
display: flex;
}

@media (max-width: vars.$media_threshold) {
.filter__type_manufacturer__wrapper {
display: flex;
}

.filter_sidebar {
//display: none;
}
}
18 changes: 10 additions & 8 deletions client/src/widgets/catalogue-serp/ui/Serp.widget.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import styles from "./styles/Serp.widget.module.css";
import styles from "./styles/Serp.widget.module.scss";
import { InstrumentDetail, InstrumentId } from "generated/model";
import { InstrumentCard } from "shared/instrument-card";

Expand All @@ -17,13 +17,15 @@ export const SerpWidget = (props: Props) => {

{props.instruments.length > 0 &&
props.instruments.map((instrument) => (
<InstrumentCard
key={instrument.instrument_id.instrument_id}
instrument={instrument}
favorite={props.favoriteInstrumentIds
.map((id) => id.instrument_id)
.includes(instrument.instrument_id.instrument_id)}
/>
<div className={styles.serp__instrument_card_wrapper}>
<InstrumentCard
key={instrument.instrument_id.instrument_id}
instrument={instrument}
favorite={props.favoriteInstrumentIds
.map((id) => id.instrument_id)
.includes(instrument.instrument_id.instrument_id)}
/>
</div>
))}
</div>
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@use "shared/styles/vars" as vars;

.serp {
display: flex;
flex-wrap: wrap;
}

.serp__instrument_card_wrapper {
width: 50%;
}

.not_found {
font-size: 2em;
margin: 0.5em;
}

@media (max-width: vars.$media_threshold) {
.serp {
flex-direction: column;
}

.serp__instrument_card_wrapper {
width: 100%;
}
}
Loading