Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfix(emptyState): set the correct size modifier using the variant prop #2692
Conversation
This comment has been minimized.
This comment has been minimized.
PatternFly-React preview: https://patternfly-react-pr-2692.surge.sh |
This comment has been minimized.
This comment has been minimized.
carlosga
commented
Aug 13, 2019
Looks good to me, thanks very much, my only question would be if it ¿shouldn't be using the getModifier function? ( as in other components ), something like:
export enum EmptyStateVariant {
large = 'lg',
small = 'sm',
full = ''
}
...
export const EmptyState: React.FunctionComponent<EmptyStateProps> = ({
children,
className = '',
variant = EmptyStateVariant.large,
...props
}: EmptyStateProps) => {
return (
<div className={css(styles.emptyState, getModifier(styles, variant), className)} {...props}>
{children}
</div>
);
};
…________________________________
De: boaz0 <notifications@github.com>
Enviado: martes, 13 de agosto de 2019 0:25
Para: patternfly/patternfly-react <patternfly-react@noreply.github.com>
Cc: Carlos Guzmán Álvarez <carlos.guzman.1@outlook.es>; Mention <mention@noreply.github.com>
Asunto: [patternfly/patternfly-react] fix(emptyState): set the correct size modifier using the variant prop (#2692)
What:
closes #2680<#2680>
//cc @jessiehuff<https://github.com/jessiehuff> can you look at this, am I missing something?
________________________________
You can view, comment on, or merge this pull request online at:
#2692
Commit Summary
* fix(emptyState): set the correct size modifier using the variant prop
File Changes
* M packages/patternfly-4/react-core/src/components/EmptyState/EmptyState.tsx<https://github.com/patternfly/patternfly-react/pull/2692/files#diff-0> (19)
* M packages/patternfly-4/react-core/src/components/EmptyState/__snapshots__/EmptyState.test.tsx.snap<https://github.com/patternfly/patternfly-react/pull/2692/files#diff-1> (4)
Patch Links:
* https://github.com/patternfly/patternfly-react/pull/2692.patch
* https://github.com/patternfly/patternfly-react/pull/2692.diff
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2692?email_source=notifications&email_token=AAFQGBPJNYPK3KR7MMX3IZDQEHPLZA5CNFSM4ILFQD4KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HE2LHHQ>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAFQGBMCFMCXJCNPXWDOBNTQEHPLZANCNFSM4ILFQD4A>.
|
This comment has been minimized.
This comment has been minimized.
@carlosga - that's a good idea. let me try and do it. |
export interface EmptyStateProps extends React.HTMLProps<HTMLDivElement> { | ||
/** Additional classes added to the EmptyState */ | ||
className?: string; | ||
/** Content rendered inside the EmptyState */ | ||
children: React.ReactNode; | ||
/** Modifies EmptyState max-width */ | ||
variant?: 'small' | 'large' | 'full'; |
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
} | ||
|
||
const maxWidthModifiers: { [variant in keyof typeof EmptyStateVariant]: string } = { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
boaz0 commentedAug 12, 2019
What:
closes #2680
//cc @jessiehuff can you look at this, am I missing something?🙏
//cc @carlosga can you look at this?