Skip to content

Commit

Permalink
Merge pull request #2023 from sahilmob/staging
Browse files Browse the repository at this point in the history
feat(kibbeh): ProfileHeaderWrapper component
  • Loading branch information
benawad authored Apr 15, 2021
2 parents aeb2071 + ed05ec0 commit fb96b76
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
26 changes: 26 additions & 0 deletions kibbeh/src/stories/ProfileHeaderWrapper.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import { Story } from "@storybook/react";
import profileCover from "./img/profile-cover.png";

import {
ProfileHeaderWrapper,
ProfileHeaderWrapperProps,
} from "../ui/ProfileHeaderWrapper";

export default {
title: "ProfileHeaderWrapper",
component: ProfileHeaderWrapper,
};

const ProfileHeaderChildren = () => (
<div className="text-accent">Profile header content</div>
);

ProfileHeaderWrapper.defaultProps = {
coverUrl: profileCover,
children: <ProfileHeaderChildren />,
};

export const Main: Story<ProfileHeaderWrapperProps> = ({ ...props }) => (
<ProfileHeaderWrapper {...props} />
);
Binary file added kibbeh/src/stories/img/profile-cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions kibbeh/src/ui/ProfileHeaderWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { ReactNode } from "react";

export interface ProfileHeaderWrapperProps {
children: ReactNode;
coverUrl: string;
}

export const ProfileHeaderWrapper: React.FC<ProfileHeaderWrapperProps> = ({
children,
coverUrl,
...props
}) => {
return (
<div className="bg-primary-800 rounded-8" {...props}>
<img
alt="cover"
src={coverUrl}
className="rounded-t-8 w-full object-cover"
/>
<div className="p-4">{children}</div>
</div>
);
};

2 comments on commit fb96b76

@vercel
Copy link

@vercel vercel bot commented on fb96b76 Apr 15, 2021

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on fb96b76 Apr 15, 2021

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

storybook-dogehouse – ./kibbeh

dogehouse.vercel.app
storybook-dogehouse-git-staging-benawad.vercel.app
storybook-dogehouse-benawad.vercel.app

Please sign in to comment.