Skip to content

Add Flex with breakpoint prop#3953

Merged
joshri merged 3 commits intomainfrom
responsive-large-info
Aug 23, 2023
Merged

Add Flex with breakpoint prop#3953
joshri merged 3 commits intomainfrom
responsive-large-info

Conversation

@joshri
Copy link
Copy Markdown
Contributor

@joshri joshri commented Aug 17, 2023

Closes: #2907

Creates styled component extension of Flex with a breakpoint prop to swap flex-direction when below a certain screen width

laggy video here:

resposive-large-info.mov

@joshri joshri added the area/ui Issues that require front-end work label Aug 17, 2023
@TheGostKasper
Copy link
Copy Markdown
Contributor

TheGostKasper commented Aug 18, 2023

I think we don't need to add the breakpoint as we can make use of the flex-wrap & between for Flex

   <Flex wide between wrap  gap="8">
        <SyncActions
          name={name}
          ...
        />
        <Flex gap="14">
          {automation?.type === "HelmRelease" ? (
            ...
          <LargeInfo
           ... />}
          />
        </Flex>
      </Flex>
redirect3-2023-08-18_13.23.27.mp4

Copy link
Copy Markdown
Contributor

@jpellizzari jpellizzari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the creatrivity, but I would also like to see if @TheGostKasper 's suggestion would work here if possible.

Comment thread ui/components/Flex.tsx Outdated
}
}

export const ColumnOnBreakpoint = styled(Styled(Flex))<{ breakpoint: number }>`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dig this 👍

@joshri
Copy link
Copy Markdown
Contributor Author

joshri commented Aug 18, 2023

We'd lose the conditional top padding, which prevents this weird spacing:
image

But also...I might be losing my mind, but when I add the wrap prop nothing happens...I have my code in the screenshot to prove I added the prop haha
image

@joshri joshri force-pushed the responsive-large-info branch from b740e20 to 116b994 Compare August 18, 2023 17:37
@TheGostKasper
Copy link
Copy Markdown
Contributor

Flex gap controls space in between, you can adjust the right gap. and by adding wrap sets whether flex items are forced onto one line or can wrap onto multiple lines.

This record without setting a gap value.

@joshri
Copy link
Copy Markdown
Contributor Author

joshri commented Aug 21, 2023

@TheGostKasper Any ideas on why the wrap prop isn't working in my code in the right half of my screenshot?

@TheGostKasper
Copy link
Copy Markdown
Contributor

I believe it's because there's no overlap in width as the Flex Row still show both div without any problems.

@joshri
Copy link
Copy Markdown
Contributor Author

joshri commented Aug 21, 2023

But the div on the right is clearly off the screen? What am I missing?

@joshri joshri force-pushed the responsive-large-info branch from 116b994 to c2cd13d Compare August 23, 2023 20:17
@joshri
Copy link
Copy Markdown
Contributor Author

joshri commented Aug 23, 2023

There was an important diff between EE and OSS here - OSS added a special component for the sync and suspend buttons a couple weeks ago that is now set to 50% width by default, allowing for the large info flex to now wrap when it runs up against it. Thanks @TheGostKasper for testing

@joshri joshri merged commit ab570bf into main Aug 23, 2023
@joshri joshri deleted the responsive-large-info branch August 23, 2023 20:34
This was referenced Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui Issues that require front-end work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Top-Right Applied Status and Time Text

3 participants