Skip to content

Commit

Permalink
UI-Additionals-Refactor (#45)
Browse files Browse the repository at this point in the history
* UI-Additionals-Refactor

* UI-Additionals-Refactor-2
  • Loading branch information
rolandlor authored Oct 11, 2024
1 parent 37f1c67 commit 153bc82
Show file tree
Hide file tree
Showing 29 changed files with 278 additions and 159 deletions.
9 changes: 5 additions & 4 deletions src/GlobalStateContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const GlobalStateProvider: React.FC<GlobalStateProviderProps> = ({
return localStorage.getItem("username") || "";
});
const [monogram, setMonogram] = useState(() => {
return localStorage.getItem("monogram") || "";
return createMonogram(localStorage.getItem("username") || "");
});

const [points, setPoints] = useState(() => {
Expand All @@ -63,11 +63,12 @@ export const GlobalStateProvider: React.FC<GlobalStateProviderProps> = ({

useEffect(() => {
localStorage.setItem("username", username);
setMonogram(createMonogram(username));
}, [username]);

useEffect(() => {
localStorage.setItem("monogram", monogram);
}, [monogram]);
// useEffect(() => {
// localStorage.setItem("monogram", monogram);
// }, [monogram]);

useEffect(() => {
localStorage.setItem("points", points.toString());
Expand Down
Binary file added src/assets/category-applied-cryptography.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 src/assets/category-coordination.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 src/assets/category-core-protocol.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 src/assets/category-crypto-economics.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 src/assets/category-cypherpunk-and-privacy.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 src/assets/category-developer-experience.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 src/assets/category-layer-2s.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 src/assets/category-real-world-ethereum.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 src/assets/category-security.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 src/assets/category-usability.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/AgendaItem/AgendaItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
gap: 6px;
padding: 8px;
box-sizing: border-box;
background-color: white;
z-index: 2;
}

.agenda-item__main {
Expand Down
49 changes: 27 additions & 22 deletions src/components/AgendaItem/AgendaItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,37 @@ const AgendaItem: React.FC<AgendaItemProps> = ({
};

return (
<div
className="agenda-item"
style={{ backgroundColor, borderRadius, paddingRight }}
>
<div className="agenda-item__main">
<div className={"agenda-item__main__time"}>
<div>{startDate}</div>
<div>{endDate}</div>
</div>
<div className="agenda-item__main__content">
<Link to={`${ROUTES.TALKS}/${id}`}>
<Link to={`${ROUTES.TALKS}/${id}`}>
<div
className="agenda-item"
style={{ backgroundColor, borderRadius, paddingRight }}
>
<div className="agenda-item__main">
<div className={"agenda-item__main__time"}>
<div>{startDate}</div>
<div>{endDate}</div>
</div>
<div className="agenda-item__main__content">
<div className="agenda-item__main__content__title">{title}</div>
</Link>
<div className="agenda-item__main__content__tagged">
{stage ? <Stage name={stage} /> : null}
{category ? (
<CategoryIndicator name={category || "no track"} />
) : null}
<div className="agenda-item__main__content__tagged">
{stage ? <Stage name={stage} /> : null}
{category ? (
<CategoryIndicator name={category || "no track"} />
) : null}
</div>
</div>
</div>
{/* use debounce if data is saved to swarm: debounce(handleClick, debounceTime) */}
<div className="agenda-item__content__heart-icon">
<HeartIcon
empty={empty}
onClick={() => {
handleClick();
}}
/>
</div>
</div>
{/* use debounce if data is saved to swarm: debounce(handleClick, debounceTime) */}
<div className="agenda-item__content__heart-icon" onClick={handleClick}>
<HeartIcon empty={empty} />
</div>
</div>
</Link>
);
};

Expand Down
2 changes: 2 additions & 0 deletions src/components/Dropdown/Dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
padding: 8px;
background-color: #4a2875;
box-shadow: 0px 2px 4px 0px #1f1f231a;
position: relative;
z-index: 3;
}

.dropdown__button__subtext {
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavigationFooter/NavigationFooter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: absolute;
bottom: 0;
left: 0;
z-index: 1;
z-index: 3;
display: flex;
justify-content: space-around;
align-items: center;
Expand Down
2 changes: 2 additions & 0 deletions src/components/NavigationHeader/NavigationHeader.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.navigation-header {
display: flex;
height: 32px;
width: fit-content;
cursor: pointer;
gap: 10px;
align-items: center;
padding: 0px 16px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/NavigationHeader/NavigationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const NavigationHeader: React.FC<NavigationHeaderProps> = ({
}
};
return (
<div className="navigation-header">
<div onClick={handleNavigation} className="navigation-header__link">
<div className="navigation-header" onClick={handleNavigation}>
<div className="navigation-header__link">
<LeftNavigationIcon />
</div>
<div className="navigation-header__text">{formattedTo}</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/RecentSessions/RecentSessions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const RecentSessions: React.FC<SessionBoxProps> = ({
<div>
<div className="recent-sessions">
<div style={{}} className="recent-sessions__title">
Recent sessions
Recent talks
</div>
<Link to={ROUTES.AGENDA}>
<div className="recent-sessions__all">All sessions</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ const RecentSessionsItem: React.FC<RecentSessionsItemProps> = ({
activeVisitors,
}) => {
return (
<div className="recent-sessions-item">
<Link to={`${ROUTES.TALKS}/${id}`}>
<div className="recent-sessions-item__title">{title}</div>
</Link>
<Link to={`${ROUTES.TALKS}/${id}`} className="recent-sessions-item">
<div className="recent-sessions-item__title">{title}</div>
<div className="recent-sessions-item__stage">
<Stage name={stage} />
</div>
<ActiveVisitors number={activeVisitors} />
</div>
</Link>
);
};

Expand Down
1 change: 1 addition & 0 deletions src/components/Spaces/Spaces.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
justify-content: space-between;
margin-bottom: 10px;
margin-top: 20px;
position: relative;
}

.recent-rooms__title {
Expand Down
6 changes: 6 additions & 0 deletions src/components/Spaces/SpacesItem/SpacesItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@
display: flex;
align-items: center;
}

.recent-rooms-item__category {
display: flex;
align-items: center;
gap: 6px;
}
12 changes: 8 additions & 4 deletions src/components/Spaces/SpacesItem/SpacesItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import "./SpacesItem.scss";
import ActiveVisitors from "../../ActiveVisitors/ActiveVisitors";
import RightArrowIcon from "../../icons/RightArrowIcon/RightArrowIcon";
import { CATEGORY_IMAGES_MAP } from "../../../utils/constants";

interface RecentRoomsItemProps {
title: string;
Expand All @@ -12,15 +13,18 @@ const RecentRoomsItem: React.FC<RecentRoomsItemProps> = ({
title,
numberOfActiveUsers,
}) => {
const imageUrl = CATEGORY_IMAGES_MAP.get(title);
return (
<div style={{}} className="recent-rooms-item">
<div className="recent-rooms__item__title">{title}</div>
<div className="recent-rooms-item__category">
{imageUrl ? (
<img src={imageUrl} alt="" width="24px" height="24px" />
) : null}
<div className="recent-rooms__item__title">{title}</div>
</div>
<div className="recent-rooms-item__right">
<ActiveVisitors number={numberOfActiveUsers} withIcon={true} />
<RightArrowIcon />
{/* <div>
<img src={rightArrowIcon} alt="" width="24px" height="24px" />
</div> */}
</div>
</div>
);
Expand Down
Loading

0 comments on commit 153bc82

Please sign in to comment.