This file has been truncated, but you can view the full file.
This file contains hidden or 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
| fetch("https://wb-api.ethz.ch/MFT/api/upload/v1/UploadChunk", { | |
| "headers": { | |
| "accept": "application/json", | |
| "accept-language": "en-US,en;q=0.9,nl;q=0.8,de;q=0.7", | |
| "authorization": "....", | |
| "cache-control": "no-cache", | |
| "content-type": "application/json", | |
| "pragma": "no-cache", | |
| "sec-fetch-dest": "empty", | |
| "sec-fetch-mode": "cors", |
This file contains hidden or 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
| module.exports = { | |
| stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | |
| addons: [ | |
| "@storybook/addon-a11y", | |
| "@storybook/addon-links", | |
| "@storybook/addon-essentials", | |
| "@storybook/preset-create-react-app", | |
| ], | |
| }; |
This file contains hidden or 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
| <span>Page {{ pagination.pageNumber + 1 }} of {{ pagination.pages.length }}:</span> | |
| {% if page.url !== pagination.href.first %}<a href="{{ pagination.href.first }}"><i class="ion-ios-skipbackward"></i></a>{% endif %} | |
| {% if pagination.href.previous %}<a href="{{ pagination.href.previous }}"><i class="ion-arrow-left-b"></i></a>{% endif %} | |
| {%- for pageEntry in pagination.pages %} | |
| {%- if (loop.index0 - pagination.pageNumber) | abs <= 3 %} | |
| <a href="{{ pagination.hrefs[ loop.index0 ] -}}" | |
| {%- if page.url === pagination.hrefs[ loop.index0 ] %} class="active"{% endif %}> | |
| {{- loop.index -}} | |
| </a> | |
| {%- endif %} |
This file contains hidden or 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
| type Person = yup.InferType<typeof personSchema>; |
This file contains hidden or 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
| const person: Person; |
This file contains hidden or 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
| type Person = { | |
| firstName: string; | |
| nickName: string | null; | |
| email?: string | null; | |
| birthDate: Date; | |
| }; |
This file contains hidden or 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
| const person = { | |
| firstName: "Matt", | |
| nickName: "The Hammer", | |
| email: "[email protected]", | |
| birthDate: new Date(1976, 9, 5) | |
| }; | |
| console.log(personSchema.isValidSync(person)); |
This file contains hidden or 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
| const personSchema = yup.object({ | |
| firstName: yup.string(), | |
| nickName: yup.string().nullable(), | |
| email: yup | |
| .string() | |
| .nullable() | |
| .notRequired() | |
| .email(), | |
| birthDate: yup | |
| .date() |
This file contains hidden or 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
| import React from 'react'; | |
| import ListGroup from 'react-bootstrap/ListGroup'; | |
| import { url } from '../../shared/jokes-api'; | |
| import Loading from '../../shared/loading'; | |
| function reducer(state, action) { | |
| switch (action.type) { | |
| case 'loaded': | |
| return { ...state, loading: false, jokes: action.payload }; |
This file contains hidden or 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
| import React, { useState } from 'react'; | |
| import useAbortableFetch from './useAbortableFetch'; | |
| const Joke = () => { | |
| const { json: joke, loading, error, abort } = useAbortableFetch( | |
| 'http://api.icndb.com/jokes/random/?limitTo=[nerdy]&escape=javascript' | |
| ); | |
| if (loading) return 'Loading...'; | |
| if (error) return 'Error: ' + error; |
NewerOlder