Skip to content

Commit

Permalink
Fix add peer popup tab layout on mobile (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
braginini authored Mar 23, 2023
1 parent 77f065b commit 5bd94ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/addpeer/AddPeerPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const AddPeerPopup: React.FC<Props> = ({

const [openTab, setOpenTab] = useState(detectOSTab);

const [width, setWidth] = useState<number>(window.innerWidth);
const isMobile = width <= 768;

const items: TabsProps['items'] = [
{
key: "1",
Expand Down Expand Up @@ -78,7 +81,7 @@ export const AddPeerPopup: React.FC<Props> = ({
To get started install NetBird and log in using your {"\n"} email account.
</Paragraph>

<Tabs centered
<Tabs centered={!isMobile}
defaultActiveKey={openTab.toString()} tabPosition="top" animated={{inkBar: true, tabPane: false}}
items={items}/>
<Paragraph type={"secondary"}
Expand Down
1 change: 0 additions & 1 deletion src/views/Peers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ export const Peers = () => {
footer={[]}
width={780}
>
{/* <AddPeerPopup greeting={"Hi there!"} headline={"It's time to add your first device."}/>*/}
<AddPeerPopup greeting={!hadFirstRun ? "Hi there!" : ""} headline={!hadFirstRun ? "It's time to add your first device." : "Add new peer"}/>
</Modal>
{confirmModalContextHolder}
Expand Down

0 comments on commit 5bd94ef

Please sign in to comment.