Skip to content

Commit

Permalink
fix: Integration feedbacks into exchange (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
RabbitDoge authored Jan 5, 2021
1 parent 3e72b2e commit fc4627a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/widgets/menu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ it("renders correctly", () => {
expect(asFragment()).toMatchInlineSnapshot(`
<DocumentFragment>
<div
class="sc-cxFLnm fwPLrC"
class="sc-cxFLnm jUhxcH"
>
<nav
class="sc-lmoMRL Pixxb"
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { MENU_HEIGHT, SIDEBAR_WIDTH_REDUCED, SIDEBAR_WIDTH_FULL } from "./config

const Wrapper = styled.div`
position: relative;
width: 100%;
`;

const StyledNav = styled.nav<{ showMenu: boolean }>`
Expand Down Expand Up @@ -94,7 +95,7 @@ const Menu: React.FC<NavProps> = ({
<Wrapper>
<StyledNav showMenu={showMenu}>
<Logo isPushed={isPushed} togglePush={() => setIsPushed((prevState: boolean) => !prevState)} isDark={isDark} />
<UserBlock account={account} closeNav={() => setIsPushed(false)} login={login} logout={logout} />
<UserBlock account={account} login={login} logout={logout} />
</StyledNav>
<BodyWrapper>
<Panel
Expand Down
5 changes: 1 addition & 4 deletions src/widgets/Menu/UserBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { Login } from "../WalletModal/types";

interface Props {
account?: string;
closeNav: () => void;
login: Login;
logout: () => void;
}

const UserBlock: React.FC<Props> = ({ account, closeNav, login, logout }) => {
const UserBlock: React.FC<Props> = ({ account, login, logout }) => {
const { onPresentConnectModal, onPresentAccountModal } = useWalletModal(login, logout, account);
const accountEllipsis = account ? `${account.substring(0, 4)}...${account.substring(account.length - 4)}` : null;
return (
Expand All @@ -21,7 +20,6 @@ const UserBlock: React.FC<Props> = ({ account, closeNav, login, logout }) => {
variant="tertiary"
onClick={() => {
onPresentAccountModal();
closeNav();
}}
>
{accountEllipsis}
Expand All @@ -31,7 +29,6 @@ const UserBlock: React.FC<Props> = ({ account, closeNav, login, logout }) => {
size="sm"
onClick={() => {
onPresentConnectModal();
closeNav();
}}
>
Connect
Expand Down

0 comments on commit fc4627a

Please sign in to comment.