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

fix: Hackathon styling and resource update #884

Merged
merged 2 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/hackathon/src/Hackathon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const Hackathon: FC<HackathonProps> = () => {
</MessageBar>
)}
<Layout hasAside>
<Aside>
<Aside width="200px">
<SideNav authorizedRoutes={authorizedRoutes} />
</Aside>
<Section>
Expand Down
8 changes: 4 additions & 4 deletions packages/hackathon/src/components/Loading/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ import React from 'react'
import { Flex, ProgressCircular, Text } from '@looker/components'

interface LoadingProps {
loading: boolean
loading?: boolean
message?: string
}

export const Loading: FC<LoadingProps> = ({
loading,
loading = true,
message = 'Loading ...',
}) => (
<Flex height="40px" alignItems="center">
<Flex height="30px" alignItems="center">
{loading && (
<>
<ProgressCircular />
<ProgressCircular size="medium" />
<Text ml="large">{message}</Text>
</>
)}
Expand Down
49 changes: 32 additions & 17 deletions packages/hackathon/src/scenes/AdminScene/AdminScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@
*/
import type { FC } from 'react'
import React, { useEffect } from 'react'
import { TabList, Tab, TabPanels, TabPanel } from '@looker/components'
import {
TabList,
Tab,
TabPanels,
TabPanel,
Heading,
SpaceVertical,
} from '@looker/components'
import { useHistory, useRouteMatch } from 'react-router-dom'
import { Routes } from '../../routes/AppRouter'
import { getTabInfo } from '../../utils'
Expand Down Expand Up @@ -59,22 +66,30 @@ export const AdminScene: FC = () => {

return (
<>
<TabList selectedIndex={tabIndex} onSelectTab={onSelectTab}>
<Tab>General</Tab>
<Tab>Configuration</Tab>
<Tab>Add Users</Tab>
</TabList>
<TabPanels selectedIndex={tabIndex}>
<TabPanel>
<div>General admin stuff TBD</div>
</TabPanel>
<TabPanel>
<UserAttributes />
</TabPanel>
<TabPanel>
<AddUsers />
</TabPanel>
</TabPanels>
<Heading as="h2" fontSize="xxxlarge" fontWeight="medium">
Admin
</Heading>
{/* Tab components incorrectly sets content height causing unnecessary
scrolling. Wrapping with SpaceVertical fixes this. TODO: Remove this hack
once tab components are fixed. */}
<SpaceVertical gap="none">
<TabList selectedIndex={tabIndex} onSelectTab={onSelectTab}>
<Tab>General</Tab>
<Tab>Configuration</Tab>
<Tab>Add Users</Tab>
</TabList>
<TabPanels selectedIndex={tabIndex}>
<TabPanel>
<div>General admin stuff TBD</div>
</TabPanel>
<TabPanel>
<UserAttributes />
</TabPanel>
<TabPanel>
<AddUsers />
</TabPanel>
</TabPanels>
</SpaceVertical>
</>
)
}
18 changes: 14 additions & 4 deletions packages/hackathon/src/scenes/HomeScene/HomeScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
import type { FC } from 'react'
import React from 'react'

import { Heading, SpaceVertical } from '@looker/components'
import { Heading, SpaceVertical, Paragraph, Span } from '@looker/components'
import type { IHackerProps } from '../../models'
import { ExtMarkdown } from '../../components'
import { Agenda } from './components'
import { localAgenda } from './agenda'

Expand All @@ -42,9 +43,18 @@ export const HomeScene: FC<HomeSceneProps> = ({ hacker }) => {
return (
<>
<SpaceVertical gap="u5">
<Heading as="h2" fontSize="xxxlarge" fontWeight="medium">
Agenda
</Heading>
<Span>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nested in span so the paragraph is not too far from Heading in SpaceVertical.

Copy link
Contributor

Choose a reason for hiding this comment

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

For v.next with artifact storage we'll schedule some design review too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Totally. I'm pretty sure I'm not following design best practices here, only aiming for what looks good. Will appreciate their input.

<Heading as="h2" fontSize="xxxlarge" fontWeight="medium">
Agenda
</Heading>
<Paragraph>
<ExtMarkdown
source={
'Please read the [Hackathon FAQ](https://community.looker.com/hackathome-2021-1026/hackathome-2021-attendee-faq-28429)!'
}
/>
</Paragraph>
</Span>
<Agenda schedule={schedule} hacker={hacker} />
</SpaceVertical>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@
import type { FC } from 'react'
import React from 'react'
import { useSelector } from 'react-redux'
import { Space, Heading } from '@looker/components'
import { isLoadingState } from '../../data/common/selectors'
import { Loading } from '../../components/Loading'
import { JudgingList } from './components'

interface JudgingSceneProps {}

export const JudgingScene: FC<JudgingSceneProps> = () => {
const isLoading = useSelector(isLoadingState)

return (
<>
<Loading loading={isLoading} message={'Processing judgings...'} />
<Space>
<Heading as="h2" fontSize="xxxlarge" fontWeight="medium">
Judgings
</Heading>
{isLoading && <Loading message={'Processing judgings...'} />}
</Space>
<JudgingList />
</>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type { FC } from 'react'
import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { useHistory } from 'react-router-dom'
import { Button, Space } from '@looker/components'
import { Button, Space, Heading } from '@looker/components'
import { Add } from '@styled-icons/material-outlined/Add'
import { Create } from '@styled-icons/material-outlined/Create'
import { Lock } from '@styled-icons/material-outlined/Lock'
Expand Down Expand Up @@ -65,7 +65,12 @@ export const ProjectsScene: FC<ProjectSceneProps> = () => {

return (
<>
<Loading loading={isLoading} message={'Processing projects...'} />
<Space>
<Heading as="h2" fontSize="xxxlarge" fontWeight="medium">
Projects
</Heading>
{isLoading && <Loading message={'Processing projects...'} />}
</Space>
<ProjectList />
<Space pt="xlarge">
<Button iconBefore={<Add />} onClick={handleAdd} disabled={isLoading}>
Expand Down
42 changes: 25 additions & 17 deletions packages/hackathon/src/scenes/ResourceScene/ResourceScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import {
Heading,
CardContent,
ButtonItem,
Paragraph,
Field,
} from '@looker/components'
import { getExtensionSDK } from '@looker/extension-sdk'
import { Routes } from '../../routes/AppRouter'
Expand Down Expand Up @@ -76,25 +78,31 @@ export const ResourceScene: FC<ResourceSceneProps> = () => {

return (
<>
<Heading as="h4" fontWeight="bold" px="medium">
Select a technology:
<Heading as="h2" fontSize="xxxlarge" fontWeight="medium">
Resources
</Heading>
<ButtonGroup
px="medium"
pt="small"
value={filterValues}
onChange={updateFilterValue}
<Paragraph mb="medium">
Here are videos, tutorials, demos, apis, datasets, and dev tools for
your hacking needs.
</Paragraph>
<Field
label="Filter by areas of interest:"
description="Select 1 or more areas"
>
<ButtonItem value="embed">Embed</ButtonItem>
<ButtonItem value="extension">Extensions</ButtonItem>
<ButtonItem value="lookml">LookML</ButtonItem>
<ButtonItem value="action">Actions</ButtonItem>
<ButtonItem value="api">API</ButtonItem>
<ButtonItem value="viz">Custom Viz</ButtonItem>
<ButtonItem value="devtool">Dev Tools</ButtonItem>
<ButtonItem value="other">Other</ButtonItem>
</ButtonGroup>
<Grid padding="medium" columns={3}>
<ButtonGroup value={filterValues} onChange={updateFilterValue}>
<ButtonItem value="embed">Embed</ButtonItem>
<ButtonItem value="extension">Extensions</ButtonItem>
<ButtonItem value="lookml">LookML</ButtonItem>
<ButtonItem value="action">Actions</ButtonItem>
<ButtonItem value="api">API</ButtonItem>
<ButtonItem value="viz">Custom Viz</ButtonItem>
<ButtonItem value="devtool">Dev Tools</ButtonItem>
<ButtonItem value="component">Components</ButtonItem>
<ButtonItem value="dataset">Datasets</ButtonItem>
<ButtonItem value="other">Other</ButtonItem>
</ButtonGroup>
</Field>
<Grid pt="medium" columns={3}>
{selectedResources.map((_k, index) => (
<Link
href={selectedResources[index].shortenedLink}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ export const resources: Array<Resource> = [
content:
'Looker Components are a collection of tools for building Looker data experiences.',
type: 'Resource',
tag: 'other',
tag: 'component',
link: 'https://components.looker.com/',
shortenedLink: 'https://bit.ly/2Z2Q69C',
title: 'Looker Components',
},
{
content: 'Looker Components Storybook contains component examples',
type: 'Resource',
tag: 'other',
tag: 'component',
link: 'https://components.looker.com/storybook',
shortenedLink: 'https://bit.ly/3pbpygP',
title: 'Components Examples Storybook',
Expand Down Expand Up @@ -178,7 +178,7 @@ export const resources: Array<Resource> = [
content:
'Thinking of doing a data analysis project for your hack? Browse and explore BigQuery public datasets through the hackathon instance',
type: 'resources',
tag: 'other',
tag: 'dataset',
link: 'https://hack.looker.com/dashboards/16',
shortenedLink: 'https://bit.ly/3FX72yF',
title: 'Public Datasets',
Expand Down
24 changes: 20 additions & 4 deletions packages/hackathon/src/scenes/UsersScene/UsersScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ import type { FC } from 'react'
import React, { useEffect } from 'react'
import { useHistory, useRouteMatch } from 'react-router-dom'
import { useDispatch, useSelector } from 'react-redux'
import { Tab, TabList, TabPanels, TabPanel } from '@looker/components'
import {
Tab,
TabList,
TabPanels,
TabPanel,
Heading,
Space,
SpaceVertical,
} from '@looker/components'
import { Routes } from '../../routes/AppRouter'
import { isLoadingState } from '../../data/common/selectors'
import { Loading } from '../../components/Loading'
Expand Down Expand Up @@ -88,9 +96,17 @@ export const UsersScene: FC<UsersSceneProps> = () => {

return (
<>
<Loading loading={isLoading} message={'Processing hackers...'} />
<Space>
<Heading as="h2" fontSize="xxxlarge" fontWeight="medium">
Users
</Heading>
{isLoading && <Loading message={'Processing users...'} />}
</Space>
{/* Tab components incorrectly sets content height causing unnecessary
scrolling. Wrapping with SpaceVertical fixes this. TODO: Remove this hack
once tab components are fixed. */}
{hackers && (
<>
<SpaceVertical gap="none">
<TabList selectedIndex={tabIndex} onSelectTab={onSelectTab}>
<Tab key="hackers">Hackers</Tab>
<Tab key="staff">Staff</Tab>
Expand Down Expand Up @@ -127,7 +143,7 @@ export const UsersScene: FC<UsersSceneProps> = () => {
/>
</TabPanel>
</TabPanels>
</>
</SpaceVertical>
)}
</>
)
Expand Down