Skip to content

Commit

Permalink
Deploy (#41)
Browse files Browse the repository at this point in the history
* main - remove uneeded code

* deploy - eslint --fix, fix docker build issue, add some logging

* deploy - only show hover logged in as when user is present
  • Loading branch information
dcordz authored Nov 3, 2024
1 parent b7acc9c commit ef360e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
12 changes: 6 additions & 6 deletions app/frontend/components/drawer/AppDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ interface IProps {
children: React.ReactNode;
}

const SearchIcon = () => <FiSearch className="pulse-text" style={{ color: SWAY_COLORS.tertiaryLight }} />;
const Noop = () => <Fragment />;

const AppDrawer: React.FC<IProps> = (props) => {
const user = useUser();

Expand All @@ -64,12 +67,12 @@ const AppDrawer: React.FC<IProps> = (props) => {
return [
{
route: ROUTES.registration,
Icon: () => <FiSearch className="pulse-text" style={{ color: SWAY_COLORS.tertiaryLight }} />,
Icon: SearchIcon,
text: <span className="pulse-text">Find Representatives</span>,
},
{
route: "divider",
Icon: () => <Fragment />,
Icon: Noop,
text: "",
},
...MenuChoices,
Expand All @@ -82,10 +85,7 @@ const AppDrawer: React.FC<IProps> = (props) => {
);

return (
<SwayDrawer
menuChoices={withFindRepresentativesPrepended}
bottomMenuChoices={bottomMenuChoices}
>
<SwayDrawer menuChoices={withFindRepresentativesPrepended} bottomMenuChoices={bottomMenuChoices}>
{props.children}
</SwayDrawer>
);
Expand Down
26 changes: 16 additions & 10 deletions app/frontend/components/drawer/SwayDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { useLogout } from "../../hooks/users/useLogout";
import { router } from "@inertiajs/react";
import { SWAY_COLORS } from "../../sway_utils";
import SocialIconsList from "../user/SocialIconsList";
import { useUser } from "app/frontend/hooks/users/useUser";
import { formatPhone } from "app/frontend/sway_utils/phone";

type MenuItem = {
route: string;
Expand All @@ -26,7 +28,8 @@ interface IProps extends PropsWithChildren {
const SwayDrawer: React.FC<IProps> = (props) => {
const logout = useLogout();

const { user, menuChoices, bottomMenuChoices } = props;
const { menuChoices, bottomMenuChoices } = props;
const user = useUser();

const handleNavigate = useCallback((route: string, state?: Record<string, any>) => {
logDev("Navigating to route -", route);
Expand Down Expand Up @@ -110,15 +113,18 @@ const SwayDrawer: React.FC<IProps> = (props) => {
key="overlay"
placement={"bottom"}
overlay={
<Popover id="sway-drawer-popover">
<Popover.Header as="h3">Logged in as:</Popover.Header>
<Popover.Body>
<div className="col">
<div className="px-0">{user?.phone}</div>
{/* <div className="px-0">{user?.email}</div> */}
</div>
</Popover.Body>
</Popover>
user?.phone ? (
<Popover id="sway-drawer-popover">
<Popover.Header as="h3">Logged in as:</Popover.Header>
<Popover.Body>
<div className="col">
<div className="px-0">{formatPhone(user.phone)}</div>
</div>
</Popover.Body>
</Popover>
) : (
<></>
)
}
>
<span style={{ zIndex: 1000 }}>
Expand Down

0 comments on commit ef360e6

Please sign in to comment.