mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-08-17 03:00:59 +03:00
Added header to example apps that points to their source code
This commit is contained in:
parent
d5a9039722
commit
602c57bd33
@ -19,6 +19,7 @@ import getFollowedArticles from '@wasp/queries/getFollowedArticles'
|
||||
import getAllArticles from '@wasp/queries/getAllArticles'
|
||||
import Navbar from './Navbar'
|
||||
import ArticleListPaginated from './article/components/ArticleListPaginated'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader'
|
||||
|
||||
const MainPage = () => {
|
||||
const { data: me } = useAuth()
|
||||
@ -135,4 +136,4 @@ const Tags = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default MainPage
|
||||
export default addWaspSourceHeader(MainPage)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import waspLogo from './waspLogo.png'
|
||||
|
||||
const WaspExampleHeader = (props) => {
|
||||
const WaspSourceHeader = (props) => {
|
||||
const divStyle = {
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
@ -27,4 +27,4 @@ const WaspExampleHeader = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default WaspExampleHeader
|
||||
export default WaspSourceHeader
|
15
examples/realworld/ext/addWaspSourceHeader.js
Normal file
15
examples/realworld/ext/addWaspSourceHeader.js
Normal file
@ -0,0 +1,15 @@
|
||||
import React from 'react'
|
||||
import WaspSourceHeader from './WaspSourceHeader.js'
|
||||
|
||||
const addWaspSourceHeader = (Component) => {
|
||||
return function AddHeader(props) {
|
||||
return (
|
||||
<>
|
||||
<WaspSourceHeader name="Realworld"/>
|
||||
<Component { ...props } />
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default addWaspSourceHeader
|
@ -16,6 +16,7 @@ import updateArticle from '@wasp/actions/updateArticle'
|
||||
import getArticle from '@wasp/queries/getArticle'
|
||||
|
||||
import Navbar from '../../Navbar'
|
||||
import addWaspSourceHeader from '../../addWaspSourceHeader'
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
/*
|
||||
@ -170,4 +171,4 @@ const ArticleEditor = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default ArticleEditorPage
|
||||
export default addWaspSourceHeader(ArticleEditorPage)
|
||||
|
@ -27,6 +27,7 @@ import createComment from '@wasp/actions/createComment'
|
||||
import deleteComment from '@wasp/actions/deleteComment'
|
||||
|
||||
import Navbar from '../../Navbar'
|
||||
import addWaspSourceHeader from '../../addWaspSourceHeader.js'
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
tags: {
|
||||
@ -244,4 +245,4 @@ CreateComment.propTypes = {
|
||||
article: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
export default ArticleViewPage
|
||||
export default addWaspSourceHeader(ArticleViewPage)
|
||||
|
@ -2,6 +2,7 @@ import React, { useState } from 'react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
|
||||
import login from '@wasp/auth/login.js'
|
||||
import addWaspSourceHeader from '../addWaspSourceHeader'
|
||||
|
||||
// TODO: A lot of duplication with the Sign up page, extract it into one component
|
||||
// and then just use it in both LoginPage and SignupPage?
|
||||
@ -28,7 +29,7 @@ const LoginPage = () => {
|
||||
return (
|
||||
<div>
|
||||
{ submitError && (
|
||||
<p> { submitError.message || submitError } </p>
|
||||
<p> { submitError.message || submitError } </p>
|
||||
) }
|
||||
|
||||
<form onSubmit={handleSubmit}>
|
||||
@ -45,4 +46,4 @@ const LoginPage = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default LoginPage
|
||||
export default addWaspSourceHeader(LoginPage)
|
||||
|
@ -3,6 +3,7 @@ import { useHistory } from 'react-router-dom'
|
||||
|
||||
import login from '@wasp/auth/login'
|
||||
import signup from '@wasp/auth/signup'
|
||||
import addWaspSourceHeader from '../addWaspSourceHeader'
|
||||
|
||||
import { errorMessage } from '../utils.js'
|
||||
|
||||
@ -51,4 +52,4 @@ const SignupPage = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default SignupPage
|
||||
export default addWaspSourceHeader(SignupPage)
|
||||
|
@ -17,6 +17,7 @@ import getArticlesByUser from '@wasp/queries/getArticlesByUser'
|
||||
import getFavoritedArticles from '@wasp/queries/getFavoritedArticles'
|
||||
import followUser from '@wasp/actions/followUser'
|
||||
import Navbar from '../../Navbar'
|
||||
import addWaspSourceHeader from '../../addWaspSourceHeader'
|
||||
import ArticleListPaginated from '../../article/components/ArticleListPaginated'
|
||||
import smileyImageUrl from '../../smiley.jpg'
|
||||
|
||||
@ -162,4 +163,4 @@ const Articles = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default UserProfilePage
|
||||
export default addWaspSourceHeader(UserProfilePage)
|
||||
|
@ -13,6 +13,7 @@ import updateUser from '@wasp/actions/updateUser'
|
||||
|
||||
import { errorMessage } from '../../utils'
|
||||
|
||||
import addWaspSourceHeader from '../../addWaspSourceHeader'
|
||||
import Navbar from '../../Navbar'
|
||||
|
||||
const UserSettingsPage = ({ user }) => {
|
||||
@ -144,4 +145,4 @@ const UserSettings = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default UserSettingsPage
|
||||
export default addWaspSourceHeader(UserSettingsPage)
|
||||
|
BIN
examples/realworld/ext/waspLogo.png
Normal file
BIN
examples/realworld/ext/waspLogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
@ -1,6 +1,7 @@
|
||||
import React from 'react'
|
||||
import TopNavbar from './TopNavbar'
|
||||
import TagsSidebar from './TagsSidebar'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader.js'
|
||||
import './Layout.css'
|
||||
|
||||
const Layout = ({ user, activeTag, children }) => (
|
||||
@ -13,4 +14,4 @@ const Layout = ({ user, activeTag, children }) => (
|
||||
</div>
|
||||
)
|
||||
|
||||
export default Layout
|
||||
export default addWaspSourceHeader(Layout)
|
||||
|
@ -2,6 +2,7 @@ import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import LoginForm from '@wasp/auth/forms/Login'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader.js'
|
||||
|
||||
const LoginPage = (props) => {
|
||||
return (
|
||||
@ -15,4 +16,4 @@ const LoginPage = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default LoginPage
|
||||
export default addWaspSourceHeader(LoginPage)
|
||||
|
@ -2,6 +2,7 @@ import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import SignupForm from '@wasp/auth/forms/Signup'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader.js'
|
||||
|
||||
const SignupPage = (props) => {
|
||||
return (
|
||||
@ -15,4 +16,4 @@ const SignupPage = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default SignupPage
|
||||
export default addWaspSourceHeader(SignupPage)
|
||||
|
30
examples/thoughts/ext/WaspSourceHeader.js
Normal file
30
examples/thoughts/ext/WaspSourceHeader.js
Normal file
@ -0,0 +1,30 @@
|
||||
import waspLogo from './waspLogo.png'
|
||||
|
||||
const WaspSourceHeader = (props) => {
|
||||
const divStyle = {
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
backgroundColor: "#212121",
|
||||
color: "#fff",
|
||||
padding: "8px 24px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
minHeight: "40px",
|
||||
height: "100%",
|
||||
filter: "drop-shadow(0 0 0.25rem gray)"
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={divStyle}>
|
||||
<span style={{ marginRight: "5px" }}><img alt="Wasp" src={waspLogo} height={30} /></span>
|
||||
<span>
|
||||
This is an example <a href="https://wasp-lang.dev" target="_blank" rel="noreferrer" style={{ color: "#fc0" }}>Wasp</a> application{props.name && ` called ${props.name}`}.
|
||||
To see the source, please visit our <a href="https://github.com/wasp-lang/wasp/tree/main/examples" target="_blank" rel="noreferrer" style={{ color: "#fc0" }}>GitHub repo</a>.
|
||||
</span>
|
||||
<span style={{ marginLeft: "5px" }}>🚀</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default WaspSourceHeader
|
15
examples/thoughts/ext/addWaspSourceHeader.js
Normal file
15
examples/thoughts/ext/addWaspSourceHeader.js
Normal file
@ -0,0 +1,15 @@
|
||||
import React from 'react'
|
||||
import WaspSourceHeader from './WaspSourceHeader.js'
|
||||
|
||||
const addWaspSourceHeader = (Component) => {
|
||||
return function AddHeader(props) {
|
||||
return (
|
||||
<>
|
||||
<WaspSourceHeader name="Thoughts" />
|
||||
<Component { ...props }/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default addWaspSourceHeader
|
BIN
examples/tutorials/TodoApp/ext/waspLogo.png
Normal file
BIN
examples/tutorials/TodoApp/ext/waspLogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
@ -2,6 +2,7 @@ import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import LoginForm from '@wasp/auth/forms/Login'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader.js'
|
||||
|
||||
import mainLogo from './waspello-logo.svg'
|
||||
import './Signup.css'
|
||||
@ -23,4 +24,4 @@ const LoginPage = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default LoginPage
|
||||
export default addWaspSourceHeader(LoginPage)
|
||||
|
@ -2,6 +2,7 @@ import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
|
||||
import SignupForm from '@wasp/auth/forms/Signup'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader.js'
|
||||
|
||||
import mainLogo from './waspello-logo.svg'
|
||||
import './Signup.css'
|
||||
@ -23,4 +24,4 @@ const SignupPage = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default SignupPage
|
||||
export default addWaspSourceHeader(SignupPage)
|
||||
|
@ -1,13 +1,12 @@
|
||||
import React from 'react'
|
||||
|
||||
import Navbar from './Navbar'
|
||||
import WaspExampleHeader from './WaspExampleHeader.js'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader.js'
|
||||
|
||||
import './UserPageLayout.css'
|
||||
|
||||
const UserPageLayout = ({ user, children }) => (
|
||||
<div className='layout-root'>
|
||||
<WaspExampleHeader name="Waspello" />
|
||||
|
||||
<Navbar user={user} />
|
||||
<div className='layout-content'>
|
||||
@ -16,4 +15,4 @@ const UserPageLayout = ({ user, children }) => (
|
||||
</div>
|
||||
)
|
||||
|
||||
export default UserPageLayout
|
||||
export default addWaspSourceHeader(UserPageLayout)
|
||||
|
30
examples/waspello/ext/WaspSourceHeader.js
Normal file
30
examples/waspello/ext/WaspSourceHeader.js
Normal file
@ -0,0 +1,30 @@
|
||||
import waspLogo from './waspLogo.png'
|
||||
|
||||
const WaspSourceHeader = (props) => {
|
||||
const divStyle = {
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
backgroundColor: "#212121",
|
||||
color: "#fff",
|
||||
padding: "8px 24px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
minHeight: "40px",
|
||||
height: "100%",
|
||||
filter: "drop-shadow(0 0 0.25rem gray)"
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={divStyle}>
|
||||
<span style={{ marginRight: "5px" }}><img alt="Wasp" src={waspLogo} height={30} /></span>
|
||||
<span>
|
||||
This is an example <a href="https://wasp-lang.dev" target="_blank" rel="noreferrer" style={{ color: "#fc0" }}>Wasp</a> application{props.name && ` called ${props.name}`}.
|
||||
To see the source, please visit our <a href="https://github.com/wasp-lang/wasp/tree/main/examples" target="_blank" rel="noreferrer" style={{ color: "#fc0" }}>GitHub repo</a>.
|
||||
</span>
|
||||
<span style={{ marginLeft: "5px" }}>🚀</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default WaspSourceHeader
|
15
examples/waspello/ext/addWaspSourceHeader.js
Normal file
15
examples/waspello/ext/addWaspSourceHeader.js
Normal file
@ -0,0 +1,15 @@
|
||||
import React from 'react'
|
||||
import WaspSourceHeader from './WaspSourceHeader.js'
|
||||
|
||||
const addWaspSourceHeader = (Component) => {
|
||||
return function AddHeader(props) {
|
||||
return (
|
||||
<>
|
||||
<WaspSourceHeader name="Waspello"/>
|
||||
<Component { ...props } />
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default addWaspSourceHeader
|
@ -4,14 +4,13 @@ import refreshDashboardData from '@wasp/queries/dashboard'
|
||||
import { useQuery } from '@wasp/queries'
|
||||
|
||||
import './style.css'
|
||||
import WaspExampleHeader from './WaspExampleHeader.js'
|
||||
import addWaspSourceHeader from './addWaspSourceHeader'
|
||||
|
||||
const MainPage = () => {
|
||||
const { data: dashboardData, isFetching, error } = useQuery(refreshDashboardData, null, { refetchInterval: 60 * 1000 })
|
||||
|
||||
return (
|
||||
<div style={{ minWidth: "800px" }}>
|
||||
<WaspExampleHeader name="Waspleau" />
|
||||
|
||||
<div className="container">
|
||||
<div className="dashboard">
|
||||
@ -37,4 +36,4 @@ const DashboardData = (props) => {
|
||||
return props.items.map((item) => <DashboardItem item={item} key={item.name} />)
|
||||
}
|
||||
|
||||
export default MainPage
|
||||
export default addWaspSourceHeader(MainPage)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import waspLogo from './waspLogo.png'
|
||||
|
||||
const WaspExampleHeader = (props) => {
|
||||
const WaspSourceHeader = (props) => {
|
||||
const divStyle = {
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
@ -24,4 +24,4 @@ const WaspExampleHeader = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
export default WaspExampleHeader
|
||||
export default WaspSourceHeader
|
15
examples/waspleau/ext/addWaspSourceHeader.js
Normal file
15
examples/waspleau/ext/addWaspSourceHeader.js
Normal file
@ -0,0 +1,15 @@
|
||||
import React from 'react'
|
||||
import WaspSourceHeader from './WaspSourceHeader.js'
|
||||
|
||||
const addWaspSourceHeader = (Component) => {
|
||||
return function AddHeader(props) {
|
||||
return (
|
||||
<>
|
||||
<WaspSourceHeader name="Waspleau"/>
|
||||
<Component { ...props } />
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default addWaspSourceHeader
|
Loading…
Reference in New Issue
Block a user