Skip to content

Commit

Permalink
add tabs layout for sidepanel
Browse files Browse the repository at this point in the history
Summary:
Adding the tabs layout per the design https://www.figma.com/design/k15bsK2WK9EuqQYmvY9s5b/Comment-Code-Suggestions?node-id=451-5443&node-type=canvas&m=dev

I tried to reuse the `<Panels>` components but realize the styling on the tab buttons is pretty different from what we want, so to move fast I decided to just to copy and modify a version that we want.

Reviewed By: evangrayk

Differential Revision: D65865727

fbshipit-source-id: c3806d4f526a12e58d523d6f7275f1a1046eb4f3
  • Loading branch information
Larry Lai authored and facebook-github-bot committed Nov 13, 2024
1 parent f4a521c commit 586552f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions addons/components/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,25 @@ const styles = stylex.create({
alignCenter: {
alignItems: 'center',
},
alignCustom: alignItems => ({
alignItems,
}),
});

/** Vertical flex layout */
export function Column(
props: ContainerProps &
(
| {alignStart: true; alignCenter?: undefined | false}
| {alignStart?: undefined | false; alignCenter: true}
| {alignStart: true; alignCenter?: undefined | false; alignItems?: undefined}
| {alignStart?: undefined | false; alignCenter?: true; alignItems?: undefined}
| {
alignStart?: undefined | false;
alignCenter?: undefined | false;
alignItems: 'stretch' | 'normal' | 'end';
}
),
) {
const {xstyle, alignStart, alignCenter, ...rest} = props;
const {xstyle, alignStart, alignCenter, alignItems, ...rest} = props;
return (
<div
{...rest}
Expand All @@ -61,6 +69,7 @@ export function Column(
xstyle,
alignStart && styles.alignStart,
alignCenter && styles.alignCenter,
alignItems && styles.alignCustom(alignItems),
)}
/>
);
Expand Down

0 comments on commit 586552f

Please sign in to comment.