Skip to content

Commit

Permalink
Merge branch 'main' into lovretomic/profile-page
Browse files Browse the repository at this point in the history
  • Loading branch information
lovretomic authored Mar 5, 2025
2 parents 29dc899 + 70e1659 commit 17a4b14
Show file tree
Hide file tree
Showing 65 changed files with 1,763 additions and 174 deletions.
3 changes: 2 additions & 1 deletion apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"clsx": "^2.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hot-toast": "^2.5.2",
"react-router-dom": "^6.14.1"
},
"devDependencies": {
"@ddays-app/types": "1.0.0",
"@ddays-app/types": "*",
"@eslint/js": "^9.13.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
Expand Down
9 changes: 9 additions & 0 deletions apps/app/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ p {
margin: 0px;
}

body {
position: relative;
overflow-x: hidden;
}

html{
overflow-x: hidden;
}

* {
box-sizing: border-box;
-moz-box-sizing: border-box;
Expand Down
8 changes: 7 additions & 1 deletion apps/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Router } from './router/Router';
import { MessageToast } from './components/MessageToast';

function App() {
return <Router />;
return (
<>
<MessageToast />
<Router />
</>
);
}

export default App;
3 changes: 3 additions & 0 deletions apps/app/src/assets/icons/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/app/src/assets/icons/close-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/app/src/assets/icons/close-page.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions apps/app/src/assets/icons/cross-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
4 changes: 4 additions & 0 deletions apps/app/src/assets/icons/icon-bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/app/src/assets/icons/rating-star-disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/app/src/assets/icons/shopping-cart-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/app/src/assets/icons/transactions-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/app/src/assets/images/coffee-mug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/app/src/assets/images/duck-shop-welcome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/app/src/assets/images/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/app/src/assets/images/t-shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/app/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Button: React.FC<ButtonProps> = ({
{...handlers}>
<div className={c.content}>
<img className={c.mr16} src={icon} alt='' />
<p>{children}</p>
<span>{children}</span>
</div>
</button>
);
Expand All @@ -61,7 +61,7 @@ const Button: React.FC<ButtonProps> = ({
})}
{...handlers}>
<div className={c.content}>
<p>{children}</p>
<span>{children}</span>
</div>
</button>
);
Expand Down
1 change: 0 additions & 1 deletion apps/app/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const Header = () => {

{isMobile && <NotificationBell />}
</div>

<HeaderCardsWrapper />
</div>
);
Expand Down
20 changes: 14 additions & 6 deletions apps/app/src/components/Header/HeaderCard/HeaderCard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
flex-direction: column;
justify-content: center;
align-items: center;

height: 20vw;
width: 20vw;
min-width: 110px;
position: relative;
min-width: 136px;
min-height: 110px;
max-width: 136px;
max-height: 136px;

border-radius: 8px;
Expand All @@ -26,7 +23,7 @@
}

p {
font-size: 14px !important;
font-size: 14px;
}
}

Expand All @@ -49,3 +46,14 @@
margin: 0;
}
}

.headerCardInner{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
gap: 12px;
width: 110px;
height: 100%;
}
34 changes: 28 additions & 6 deletions apps/app/src/components/Header/HeaderCard/HeaderCard.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
import { PropsWithChildren } from 'react';
import styles from './HeaderCard.module.scss';

interface HeaderCardProps {
img: string;
text: string;
width: number;
height: number;
imgWidth: number;
imgHeight: number;
onClick?: () => void;
width?: number | null;
height?: number | null;
}
export const HeaderCard = ({ img, text, width, height }: HeaderCardProps) => {
export const HeaderCard = ({
img,
text,
imgWidth,
imgHeight,
onClick = () => {},
width = null,
height = null,
children,
}: PropsWithChildren<HeaderCardProps>) => {
return (
<div className={styles.headerCard}>
<img src={img} alt={text} width={width} height={height} />
<p>{text}</p>
<div
className={styles.headerCard}
onClick={onClick}
style={{
...(width ? { width: `${width}px` } : {}),
...(height ? { height: `${height}px` } : {}),
}}>
<div className={styles.headerCardInner}>
<img src={img} alt={text} width={imgWidth} height={imgHeight} />
<p>{text}</p>
{children}
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useNavigate } from 'react-router-dom';
import { HeaderCard } from '../HeaderCard/HeaderCard';
import accreditationImage from './../../../assets/images/accreditationIcon.png';
import enterCodeImage from './../../../assets/images/enterCodeIcon.png';
import tShirtImage from './../../../assets/images/tShirtIcon.png';
import styles from './HeaderCardsWrapper.module.scss';
import { RouteNames } from '../../../router/routes';

enum HeaderCards {
ENTER_CODE,
Expand All @@ -16,42 +18,48 @@ type HeaderCardsInfo = {
text: string;
width: number;
height: number;
onClick?: () => void;
};

const headerCards: HeaderCardsInfo[] = [
{
id: HeaderCards.ENTER_CODE,
img: `${enterCodeImage}`,
text: 'Unesi kod',
width: 77,
height: 34,
},
{
id: HeaderCards.ACCREDITATION,
img: `${accreditationImage}`,
text: 'Akreditacija',
width: 60,
height: 39,
},
{
id: HeaderCards.SHOPPING,
img: `${tShirtImage}`,
text: 'Shopping',
width: 80,
height: 36,
},
];

export const HeaderCardsWrapper = () => {
const navigate = useNavigate();
const headerCards: HeaderCardsInfo[] = [
{
id: HeaderCards.ENTER_CODE,
img: `${enterCodeImage}`,
text: 'Unesi kod',
width: 77,
height: 34,
onClick: () => {},
},
{
id: HeaderCards.ACCREDITATION,
img: `${accreditationImage}`,
text: 'Akreditacija',
width: 60,
height: 39,
onClick: () => {},
},
{
id: HeaderCards.SHOPPING,
img: `${tShirtImage}`,
text: 'Shopping',
width: 80,
height: 36,
onClick: () => navigate(RouteNames.SHOPPING),
},
];

return (
<div className={styles.headerCardsWrapper}>
{headerCards.map((card) => (
<HeaderCard
key={card.id}
img={card.img}
text={card.text}
width={card.width}
height={card.height}
imgWidth={card.width}
imgHeight={card.height}
onClick={card.onClick}
/>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
.notification{
&Wrapper {
position: relative;
}
.notification {
&Wrapper {
position: relative;
cursor: pointer;
}

&Icon{
margin: 0;
padding: 0;
}

&Badge{
position: absolute;
top: -15px;
right: -10px;
&Icon {
margin: 0;
padding: 0;
}

width: 27px;
height: 27px;
&Badge {
position: absolute;
top: -15px;
right: -10px;

background-color: $primary-highlight;
border: 2px solid $primary-black;
border-radius: 4px;
width: 27px;
height: 27px;

display: flex;
justify-content: center;
align-items: center;
}
background-color: $primary-highlight;
border: 2px solid $primary-black;
border-radius: 4px;

display: flex;
justify-content: center;
align-items: center;
}

@media (max-width: $breakpoint-mobile-lg) {
&Wrapper{
margin-right: 10px;
}
@media (max-width: $breakpoint-mobile-lg) {
&Wrapper {
margin-right: 10px;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import sprite from './../../../assets/sprite.svg';
import sprite from '@/assets/sprite.svg';
import styles from './NotificationBell.module.scss';
import { useNavigate } from 'react-router-dom';
import { RouteNames } from '../../../router/routes';

export const NotificationBell: React.FC = () => {
const navigate = useNavigate();

export const NotificationBell = () => {
return (
<div className={styles.notificationWrapper}>
<div
className={styles.notificationWrapper}
onClick={() => navigate(RouteNames.NOTIFICATIONS)}>
<svg className={styles.notificationIcon} width={32} height={32}>
<use href={`${sprite}#notification-bell-icon`} />
</svg>
Expand Down
8 changes: 6 additions & 2 deletions apps/app/src/components/Input/Input.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
.inputWrapper {
position: relative;
width: 100%;
background-color: aqua;
}

.input {
Expand Down Expand Up @@ -75,8 +74,13 @@
position: absolute;
right: 0px;
top: 50%;
transform: translateY(-50%);
transform: translateY(-60%);
background: transparent;
border: none;
cursor: pointer;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}
4 changes: 2 additions & 2 deletions apps/app/src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import c from './Input.module.scss';
import clsx from 'clsx';
import EyeIcon from '../../assets/icons/Eye open.svg';
import EyeClosedIcon from '../../assets/icons/Eye closed.svg';
import EyeIcon from '../../assets/icons/eye-open.svg';
import EyeClosedIcon from '../../assets/icons/eye-closed.svg';

type InputProps = {
value: string;
Expand Down
Loading

0 comments on commit 17a4b14

Please sign in to comment.