Skip to content

Commit

Permalink
Kazuhisa Hashimoto 🎈 (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
baptadn authored Feb 27, 2020
1 parent 0da95f6 commit c8c29e9
Show file tree
Hide file tree
Showing 6 changed files with 1,436 additions and 28 deletions.
7 changes: 1 addition & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,16 @@ import { Global } from '@emotion/core'
import { HotKeys } from 'react-hotkeys'
import useShortcuts, { keyMap } from './hooks/useShortcuts'
import EditorErrorBoundary from './components/errorBoundaries/EditorErrorBoundary'
import useProducthunt from './hooks/useProducthunt'
import { InspectorProvider } from './contexts/inspector-context'

const App = () => {
const { handlers } = useShortcuts()

// To remove soon :)
useProducthunt()

return (
<HotKeys allowChanges handlers={handlers} keyMap={keyMap}>
<Global
styles={() => ({
html: { minWidth: '860px' },
html: { minWidth: '860px', backgroundColor: '#1a202c' },
})}
/>

Expand All @@ -41,7 +37,6 @@ const App = () => {
<Box
maxH="calc(100vh - 3rem)"
flex="0 0 15rem"
roundedRight={10}
bg="#f7fafc"
overflowY="auto"
overflowX="visible"
Expand Down
1 change: 0 additions & 1 deletion src/components/inspector/Inspector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const Inspector = () => {
fontWeight="semibold"
fontSize="md"
color="yellow.900"
rounded="md"
py={2}
px={2}
shadow="sm"
Expand Down
19 changes: 0 additions & 19 deletions src/hooks/useProducthunt.ts

This file was deleted.

9 changes: 9 additions & 0 deletions src/hooks/useShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export const keyMap = {
UNSELECT: ['Escape'],
PARENT: 'p',
DUPLICATE: ['ctrl+d', 'cmd+d'],
KONAMI_CODE: [
'up up down down left right left right b a',
'up up down down left right left right B A',
],
}

const hasNoSpecialKeyPressed = (event: KeyboardEvent | undefined) =>
Expand Down Expand Up @@ -77,6 +81,10 @@ const useShortcuts = () => {
dispatch.components.duplicate()
}

const onKonamiCode = () => {
dispatch.components.loadDemo('secretchakra')
}

const handlers = {
DELETE_NODE: deleteNode,
TOGGLE_BUILDER_MODE: toggleBuilderMode,
Expand All @@ -86,6 +94,7 @@ const useShortcuts = () => {
UNSELECT: onUnselect,
PARENT: onSelectParent,
DUPLICATE: onDuplicate,
KONAMI_CODE: onKonamiCode,
}

return { handlers }
Expand Down
6 changes: 4 additions & 2 deletions src/templates/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { onboarding } from './onboarding'
import { productHunt } from './producthunt'
import { secretchakra } from './secretchakra'

export type TemplateType = 'onboarding' | 'ph'
export type TemplateType = 'onboarding' | 'ph' | 'secretchakra'

const templates: {
[id in TemplateType]: IComponents
} = {
ph: productHunt,
onboarding: onboarding,
onboarding,
secretchakra,
}

export default templates
Loading

0 comments on commit c8c29e9

Please sign in to comment.