Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Flex with breakpoint prop #3953

Merged
merged 3 commits into from
Aug 23, 2023
Merged

Add Flex with breakpoint prop #3953

merged 3 commits into from
Aug 23, 2023

Conversation

joshri
Copy link
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
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

@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.

@@ -59,4 +59,10 @@ class Flex extends React.PureComponent<Props> {
}
}

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

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
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

@TheGostKasper
Copy link
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
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
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
Contributor Author

joshri commented Aug 21, 2023

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

@joshri
Copy link
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
19 checks passed
@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