Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Sep 21, 2023
1 parent 5198546 commit 2be23a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
4 changes: 2 additions & 2 deletions apps/governance/src/components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const ExternalLink = ({ size = 14 }: { size?: number }) => (
</svg>
);

export const Sync = ({ size = 28 }: { size?: number }) => (
export const SyncIcon = ({ size = 28 }: { size?: number }) => (
<svg
height={size}
width={size}
Expand Down Expand Up @@ -70,7 +70,7 @@ export const CaretDown = ({
</svg>
);

export const Profile = ({ size = 28 }: { size?: number }) => (
export const ProfileIcon = ({ size = 28 }: { size?: number }) => (
<svg height={size} width={size}>
<rect
x="0"
Expand Down
10 changes: 5 additions & 5 deletions apps/governance/src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAccountModal, useConnectModal } from '@rainbow-me/rainbowkit';
import { useAccount } from 'wagmi';

import Logo from '../assets/logo.svg';
import { Profile, Sync } from '../components/Icons';
import { ProfileIcon, SyncIcon } from '../components/Icons';
import { Tabs } from '../components/Tabs';
import { truncateAddress } from '../utils/string';

Expand All @@ -21,13 +21,13 @@ export const Nav = () => {
<span className="hidden sm:inline">{'View on '}</span>IPFS
</button>

{isConnected && address ? (
{isConnected ? (
<button
className="btn-secondary px-4 py-2 flex items-center gap-3 font-medium self-stretch"
onClick={openAccountModal}
>
<div className="rounded-full overflow-hidden">
<Profile />
<ProfileIcon />
</div>
<div>{truncateAddress(address)}</div>
</button>
Expand All @@ -36,8 +36,8 @@ export const Nav = () => {
Connect
</button>
)}
<button className="btn-secondary px-2 py-2 text-blue-500">
<Sync />
<button className="btn-secondary p-2 text-blue-500">
<SyncIcon />
</button>
</div>
</div>
Expand Down
15 changes: 4 additions & 11 deletions apps/governance/src/components/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import { Link, useLocation } from 'react-router-dom';
const underlineClass = `absolute left-0 right-0 h-[2px] bg-blue-gradient -bottom-px rounded-full`;
const underlineHoverClass = `absolute left-0 right-0 h-[2px] bg-blue-gradient opacity-0 group-hover:opacity-100 brightness-50 -bottom-px rounded-full transition-all duration-200 ease-in-out`;

export const Tabs = (props: {
interface TabsProps {
tabs: {
label: string;
href: string;
}[];
className?: string;
}) => {
}

export const Tabs = (props: TabsProps) => {
const location = useLocation();
const activeTab = props.tabs.findIndex(
(tab) => tab.href === location.pathname,
Expand Down Expand Up @@ -72,12 +74,3 @@ export const Tabs = (props: {
</div>
);
};

// const BottomBorder = ({ active }: { active: boolean }) => {
// const hoverStyle = useSpring({
// from: { opacity: 0 },
// to: { opacity: active ? 100 : 0 },
// });

// return <animated.div style={hoverStyle} className={underlineClass} />;
// };

0 comments on commit 2be23a5

Please sign in to comment.