Skip to content

Commit

Permalink
basic exchange layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz Nowak committed Oct 22, 2023
1 parent f50dd4f commit bd35a21
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 3 deletions.
33 changes: 33 additions & 0 deletions src/routes/exchange/[market]/index.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { style } from "@vanilla-extract/css";
import { vars } from "~/theme.css";

const background = style({
backgroundColor: vars.color.background,
});

export const mainBuySell = style({
height: "100%",
display: "grid",
gridTemplateColumns: "1fr 300px",
gap: "1px",
});

export const buySell = style([background, {}]);

export const mainPosition = style({
display: "grid",
gridTemplateRows: "1fr 350px",
gap: "1px",
});

export const position = style([background, {}]);

export const chartOrderbook = style({
display: "grid",
gridTemplateColumns: "1fr 350px",
gap: "1px",
});

export const chart = style([background, {}]);

export const orderbook = style([background, {}]);
22 changes: 21 additions & 1 deletion src/routes/exchange/[market]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { component$ } from "@builder.io/qwik";
import { type RequestHandler, routeLoader$ } from "@builder.io/qwik-city";
import { parseMarket } from "./parseMarket";
import {
buySell,
chart,
chartOrderbook,
mainBuySell,
mainPosition,
orderbook,
position,
} from "./index.css";

export const onRequest: RequestHandler = ({ params, redirect, sharedMap }) => {
try {
Expand All @@ -24,5 +33,16 @@ export default component$(() => {
console.log(quoteAsset);
console.log(baseAsset);

return <></>;
return (
<div class={mainBuySell}>
<div class={mainPosition}>
<div class={chartOrderbook}>
<div class={chart}></div>
<div class={orderbook}></div>
</div>
<div class={position}></div>
</div>
<div class={buySell}></div>
</div>
);
});
13 changes: 13 additions & 0 deletions src/routes/exchange/index.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { style } from "@vanilla-extract/css";
import { vars } from "~/theme.css";

const background = style({
backgroundColor: vars.color.background,
});

export const index = style([
background,
{
height: "100%",
},
]);
3 changes: 2 additions & 1 deletion src/routes/exchange/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { component$ } from "@builder.io/qwik";
import type { DocumentHead } from "@builder.io/qwik-city";
import { index } from "./index.css";

export default component$(() => {
return <></>;
return <div class={index}></div>;
});

export const head: DocumentHead = {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/main.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const desktop: ComplexStyleRule = {
export const main = style([
mobile,
{
backgroundColor: vars.color.background,
backgroundColor: vars.color.backgroundHighlight,
"@media": {
[mediaQuery.desktop]: desktop,
},
Expand Down

0 comments on commit bd35a21

Please sign in to comment.