Skip to content

Commit

Permalink
feat(header): remove placeholders
Browse files Browse the repository at this point in the history
Removes the user avatar placeholders on the page header, and the group name

#62
  • Loading branch information
kanej committed Oct 25, 2019
1 parent 8b01965 commit af498e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 42 deletions.
45 changes: 4 additions & 41 deletions src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,15 @@ const HEADER_HEIGHT = 80
const FOOTER_HEIGHT = 60
const BACKGROUND = '3578E5'

function useLayout({ store }: { store: Store }) {
const members = [1, 2, 3, 4, 5]

useEffect(() => {
store.groupsGetAll()
}, [store])

return {
members
}
}

export interface LayoutProps {
store: Store
children: ReactElement
}

const Layout = ({ store, children }: LayoutProps) => {
const { members } = useLayout({
store
})
useEffect(() => {
store.groupsGetAll()
}, [store])

return (
<Section>
Expand All @@ -43,20 +31,7 @@ const Layout = ({ store, children }: LayoutProps) => {
Permaweb
</Title>
<Bar>
<Sub>Group name</Sub>
<Info>
<div>90</div>
<Members maxCount={5}>
{members.map((member, i) => {
return (
<Img
src="https://picsum.photos/seed/picsum/30/30"
alt=""
key={i}
/>
)
})}
</Members>
<div>Share</div>
<div>Edit</div>
</Info>
Expand Down Expand Up @@ -119,17 +94,12 @@ const Title = styled.h1`

const Bar = styled.div`
display: grid;
grid-template-columns: auto 1fr;
grid-template-columns: auto;
align-items: center;
height: ${HEADER_HEIGHT}px;
padding: 0 10px;
`

const Sub = styled.h2`
padding: 0;
margin: 0;
`

const Info = styled.div`
display: inline-grid;
grid-template-columns: auto auto auto auto;
Expand All @@ -138,13 +108,6 @@ const Info = styled.div`
margin-left: auto;
`

const Members = styled.div`
display: grid;
grid-template-columns: ${({ maxCount }: { maxCount: number }) =>
`repeat(${maxCount}, auto)`};
grid-gap: 5px;
`

/* content */

const Main = styled.main`
Expand Down
1 change: 0 additions & 1 deletion src/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class Store {
}

@action
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async groupsAdd(groupName: string) {
if (!this.schema) {
throw new Error('Schema not loaded')
Expand Down

0 comments on commit af498e7

Please sign in to comment.