-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
892 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
{ | ||
"presets": ["@babel/preset-env"] | ||
"presets": [ | ||
"@babel/preset-typescript", | ||
[ | ||
"@babel/preset-react", | ||
{ | ||
"runtime": "automatic", | ||
"importSource": "preact" | ||
} | ||
], | ||
"@babel/preset-env" | ||
], | ||
"env": { | ||
"development": { | ||
"presets": [ | ||
[ | ||
"@babel/preset-react", | ||
{ | ||
"development": true, | ||
"runtime": "automatic", | ||
"importSource": "preact" | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Spinner } from '@hypothesis/frontend-shared'; | ||
|
||
export default function NewGroupApp() { | ||
return ( | ||
<> | ||
<Spinner /> | ||
<p>Hello <span className="bg-black text-white">Tailwind!</span></p> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { render } from 'preact'; | ||
|
||
import NewGroupApp from './components/NewGroupApp'; | ||
|
||
export function init() { | ||
const rootEl = document.querySelector('#app'); | ||
|
||
render( | ||
<NewGroupApp />, | ||
rootEl | ||
); | ||
} | ||
|
||
init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"allowSyntheticDefaultImports": true, | ||
"checkJs": true, | ||
"lib": ["es2018", "dom"], | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "preact", | ||
"module": "commonjs", | ||
"noEmit": true, | ||
"strict": true, | ||
"target": "ES2020", | ||
"useUnknownInCatchVariables": false | ||
}, | ||
"include": ["**/*.js", "**/*.ts", "**/*.tsx"], | ||
"exclude": [ | ||
// Tests and test infrastructure | ||
"**/test/*.js", | ||
"bootstrap.js", | ||
"karma.config.cjs" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* CSS entry point for the 'new group' app. */ | ||
|
||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
{% extends "h:templates/layouts/group.html.jinja2" %} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Create a new private group</title> | ||
{% for url in asset_urls("new_group_css") %} | ||
<link rel="stylesheet" href="{{ url }}"> | ||
{% endfor %} | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
|
||
{% set page_title = 'Create a new private group' %} | ||
|
||
{% block page_content %} | ||
<h1 class="form-header">Create a new private group</h1> | ||
{{ form }} | ||
|
||
<footer class="form-footer"> | ||
{# This form has at least one required field. If that changes we should update this footer. #} | ||
<span class="form-footer__required"> | ||
<span class="form-footer__symbol"> | ||
* | ||
</span> | ||
<span class="form-footer__text"> | ||
Required | ||
</span> | ||
</span> | ||
</footer> | ||
{% endblock page_content %} | ||
{% for url in asset_urls("new_group_js") %} | ||
<script type="module" src="{{ url }}"></script> | ||
{% endfor %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import tailwindConfig from '@hypothesis/frontend-shared/lib/tailwind.preset.js'; | ||
|
||
export default { | ||
presets: [tailwindConfig], | ||
content: [ | ||
'./h/static/scripts/**/*.{js,ts,tsx}', | ||
'./node_modules/@hypothesis/frontend-shared/lib/**/*.js', | ||
], | ||
theme: { | ||
extend: { | ||
animation: { | ||
'fade-in': 'fade-in 0.3s forwards', | ||
'fade-out': 'fade-out 0.3s forwards', | ||
'slide-in-from-right': 'slide-in-from-right 0.3s forwards ease-in-out', | ||
}, | ||
fontFamily: { | ||
sans: [ | ||
'"Helvetica Neue"', | ||
'Helvetica', | ||
'Arial', | ||
'"Lucida Grande"', | ||
'sans-serif', | ||
], | ||
}, | ||
boxShadow: { | ||
// Similar to tailwind's default `shadow-inner` but coming from the | ||
// right edge instead of the left | ||
'r-inner': 'inset -2px 0 4px 0 rgb(0,0,0,.05)', | ||
}, | ||
keyframes: { | ||
'fade-in': { | ||
'0%': { | ||
opacity: '0', | ||
}, | ||
'100%': { | ||
opacity: '1', | ||
}, | ||
}, | ||
'fade-out': { | ||
'0%': { | ||
opacity: '1', | ||
}, | ||
'100%': { | ||
opacity: '0', | ||
}, | ||
}, | ||
'slide-in-from-right': { | ||
'0%': { | ||
opacity: '0', | ||
left: '100%', | ||
}, | ||
'80%': { | ||
left: '-10px', | ||
}, | ||
'100%': { | ||
left: '0', | ||
opacity: '1', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.