diff --git a/client/src/app.tsx b/client/src/app.tsx index 7dbc6c5..a81e3d5 100644 --- a/client/src/app.tsx +++ b/client/src/app.tsx @@ -19,7 +19,7 @@ import Info from './routes/info'; if (window.location.host === 'matescrates.au') LogRocket.init('yh0dy3/mcrates'); const Main = () => { - const dispatch = useDispatch() + const dispatch = useDispatch(); // i have no idea why this is needed, // but it makes sure the user changes actually rerender diff --git a/client/src/routes/login.tsx b/client/src/routes/login.tsx index f712487..0dca412 100644 --- a/client/src/routes/login.tsx +++ b/client/src/routes/login.tsx @@ -97,9 +97,8 @@ function LoginPage({ mode }) { return (
-
-
- + +

Mates Crates is a record importing service.

We bundle orders together from thousands of online stores to reduce the cost of shipping vinyl.

Based in Preston.

diff --git a/client/src/routes/offers.tsx b/client/src/routes/offers.tsx index d1ac1ae..98fd108 100644 --- a/client/src/routes/offers.tsx +++ b/client/src/routes/offers.tsx @@ -16,6 +16,8 @@ function Home() { route('/search'); } + if (!offers) return
loading...
; + return (
{offers.map(OfferGroup)} diff --git a/client/src/routes/search.tsx b/client/src/routes/search.tsx index 0b6faaa..2394b89 100644 --- a/client/src/routes/search.tsx +++ b/client/src/routes/search.tsx @@ -104,8 +104,7 @@ const User = () => {

Data provided by Discogs.

-
-
+
{infoEl} {results.map(Result)} {topEl} diff --git a/client/src/store.tsx b/client/src/store.tsx index a25dd5d..053f377 100644 --- a/client/src/store.tsx +++ b/client/src/store.tsx @@ -11,7 +11,7 @@ export const userState = createSlice({ export const offersState = createSlice({ name: 'offers', - initialState: [], + initialState: null, reducers: { set: (state, action) => action.payload }, diff --git a/client/src/style/index.less b/client/src/style/index.less index 4c4cccb..33e679b 100644 --- a/client/src/style/index.less +++ b/client/src/style/index.less @@ -201,7 +201,7 @@ body { } main { - padding: 0 5% 0 5%; + padding: 0 var(--spacing-double) 0 var(--spacing-double); } button, [type=submit] { @@ -212,19 +212,27 @@ button, [type=submit] { .landing { display: grid; - grid-template-columns: 1fr 0.5fr 2fr; + + grid-template-columns: 1fr 2fr; + grid-gap: calc(var(--spacing-double) * 2); + grid-template-areas: + "login swirl" + "login words"; .login { + grid-area: login; button { width: 100%; } } .swirl { + grid-area: swirl; height: 15rem; } - .text { + .words { + grid-area: words; text-align: center; } } @@ -274,13 +282,18 @@ article { .search { display: grid; - grid-template-columns: 1fr 0.5fr 2fr; + grid-template-columns: 1fr 2fr; - article { + .results { display: grid; - padding: var(--spacing); - margin-bottom: var(--spacing); - grid-template-columns: 1fr 4fr 1fr; + padding-left: var(--spacing); + grid-gap: var(--spacing); + + article { + display: grid; + padding: var(--spacing); + grid-template-columns: 1fr 4fr min-content; + } } button { @@ -300,8 +313,7 @@ article { grid-template-columns: 1fr 1fr 1fr; - grid-row-gap: var(--spacing); - grid-column-gap: var(--spacing); + grid-gap: var(--spacing); article { display: grid; @@ -324,6 +336,10 @@ article { } padding: var(--spacing); + + img { + justify-self: end; + } } } @@ -412,6 +428,7 @@ header { .offers { display: grid; grid-template-columns: 1fr 1fr; + grid-gap: var(--spacing); .offer { display: grid; @@ -422,7 +439,6 @@ header { "lines lines"; padding: var(--spacing); - margin: var(--spacing-half); background: var(--background-1); .details { @@ -482,4 +498,46 @@ header { background-position: center; margin-bottom: var(--spacing); -} \ No newline at end of file +} + +@media (max-width:900px) { + .landing { + grid-template-columns: 1fr; + grid-template-areas: + "swirl" + "login" + "words"; + } + + .list { + grid-template-columns: 1fr; + } + + .search { + grid-template-columns: 1fr; + } + + .offers { + grid-template-columns: 1fr; + } + + .info { + grid-template-columns: 1fr; + // is necessary for some reason + grid-template-areas: + "swirl" + "contact" + "words"; + } + + main { + padding: 0 var(--spacing) 0 var(--spacing); + } +} + +@media (max-width:1200px) { + img { + width: 5rem; + } +} + diff --git a/client/src/template.html b/client/src/template.html new file mode 100644 index 0000000..ce1e78f --- /dev/null +++ b/client/src/template.html @@ -0,0 +1,14 @@ + + + + + matescrates.au - record import service + + + + <% preact.headEnd %> + + + <% preact.bodyEnd %> + + \ No newline at end of file