Skip to content

Commit

Permalink
Merge pull request #36 from Chamindu36/ts-dev-migration
Browse files Browse the repository at this point in the history
Add styles and media queries to support mobile UIs and Making this a bit responsive UI.
  • Loading branch information
Chamindu36 committed Sep 4, 2023
2 parents 8e78063 + 17d1c08 commit e7efb75
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 22 deletions.
3 changes: 3 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Shop from "./routes/shop/shop.component";
import Checkout from "./routes/checkout/checkout.component";
import Spinner from "./components/spinner/spinner.component";

import { GlobalStyle } from "./global.styles";

// import Home from "./routes/home/home.component";
// import Authentication from "./routes/authentication/authentication.component";

Expand All @@ -29,6 +31,7 @@ const App = () => {
//fallback is the component to be rendered while the lazy component is loading
return (
<Suspense fallback={<Spinner />}>
<GlobalStyle />
<Routes>
<Route path="/" element={<Navigation />}>
<Route index element={<Home />} />
Expand Down
4 changes: 4 additions & 0 deletions src/components/directory-item/directory-item.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ export const DirectoryItemContainer = styled.div`
opacity: 0.9;
}
}
@media screen and (max-width: 800px) {
height: 200px;
}
`;
25 changes: 25 additions & 0 deletions src/global.styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { createGlobalStyle } from "styled-components";

export const GlobalStyle = createGlobalStyle`
body {
margin: 0;
padding: 20px 40px;
font-family: 'Saira Condensed', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
a {
text-decoration: none;
color: black;
}
* {
box-sizing: border-box;
}
`;
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Elements } from '@stripe/react-stripe-js';
import { store, persistor } from './store/store';
import { stripePromise } from './utils/stripe/stripe.utils';

import './index.scss';
import App from './App';
import reportWebVitals from './reportWebVitals';

Expand Down
21 changes: 0 additions & 21 deletions src/index.scss

This file was deleted.

15 changes: 15 additions & 0 deletions src/routes/navigation/navigation.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@ export const NavigationContainer = styled.div`
display: flex;
justify-content: space-between;
margin-bottom: 25px;
@media screen and (max-width: 800px) {
height: 200px;
padding: 10px 20px;
margin-bottom: 20px;
}
`;

export const LogoContainer = styled(Link)`
height: 100 %;
width: 70px;
padding: 25px;
@media screen and (max-width: 800px) {
height: 50px;
padding: 0px;
}
`;

export const NavLinks = styled.div`
Expand All @@ -21,6 +32,10 @@ export const NavLinks = styled.div`
display: flex;
align - items: center;
justify - content: flex - end;
@media screen and (max-width: 800px) {
width: 80%;
}
`;

export const NavLink = styled(Link)`
Expand Down

0 comments on commit e7efb75

Please sign in to comment.