Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
ddprrt committed Oct 31, 2018
0 parents commit 8220b96
Show file tree
Hide file tree
Showing 24 changed files with 14,055 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"next/babel",
"@zeit/next-typescript/babel"
]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.next
node_modules
.vscode
.DS_Store
7 changes: 7 additions & 0 deletions @types/css.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module '*.css' {
interface IClassNames {
[className: string]: string
}
const classNames: IClassNames;
export = classNames;
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
...
9 changes: 9 additions & 0 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React, { SFC } from 'react';

import '../styles/Layout.css';

const Layout: SFC<{}> = ({ children }) => {
return <div className="wrapper">{children}</div>
}

export default Layout;
40 changes: 40 additions & 0 deletions components/Podcaster.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React, { SFC } from 'react';
import Link from 'next/link';

import '../styles/Podcaster.css'

const TwitterImage:SFC<{ twitter?: string, name: string, id: string}> = ({ twitter, name, id }) => {
if(twitter) {
return <img className="avatar"
src={`/people/${id}/image`}
width="73" height="73" alt={`Twitter avatar von ${name}`}/>
}
return <img className="avatar"
src="https://resources.whatwg.org/logo.svg"
width="73" height="73" alt={`Kein Bild für ${name} verfügbar`}/>
}

const ConditionalLink:SFC<{ id: string, full?: boolean}> = ({ id, full = false, children}) => {
if (full) {
return <div className="card">{ children }</div>
}
return <Link as={`/podcaster/${id}`} href={`/podcaster?id=${id}`}>
<a className="card">
{ children }
</a>
</Link>
}

export const Podcaster: SFC<{ person: Person, full?: boolean }> = ({ person, full = false }) => {
return <ConditionalLink full={full} id={person.id}>
<div className="podcaster-card">
<TwitterImage twitter={person.twitter} name={person.name} id={person.id} />
<div className="podcaster-group">
<h3>{person.name}</h3>
<p>
Episoden: {person.episodes}
</p>
</div>
</div>
</ConditionalLink>
}
Loading

0 comments on commit 8220b96

Please sign in to comment.