Skip to content

Instantly share code, notes, and snippets.

View albertdugba's full-sized avatar
💭
I play around my screen trying to break and unbreak things

Albert 🇬🇭 albertdugba

💭
I play around my screen trying to break and unbreak things
View GitHub Profile
import { useMutation, useQueryClient } from 'react-query';
const queryClient = useQueryClient();
const handleFileChange = event => {
setBookName(event.target.files[0].name);
setSelectedBook(event.target.files[0]);
};
const handleFileUpload = event => {
event.preventDefault();
import React, { useEffect, useState, useRef, useCallback } from "react";
import { createPortal } from "react-dom";
import * as PDFJS from "pdfjs-dist/build/pdf";
import PDFJSWORKER from "pdfjs-dist/build/pdf.worker.entry";
import "./misc/textLayer";
import "./misc/textLayer.css";
window.PDFJS = PDFJS;
export default function PdfViewer({ url }) {
@albertdugba
albertdugba / breakpoints.js
Created December 29, 2020 15:44
Media Query in styled-components
import styled,{css} from 'styled-components';
const size = {
small: 400,
medium: 960,
large: 1140,
};
const mediaQuery = Object.keys(size).reduce((acc, label) => {
acc[label] = (...args) => css`
@media (min-width: ${size[label]}px) {
Scaffold(
appBar: AppBar(
title: AutoSizeText('Doctors List'),
bottom: PreferredSize(child: Row(children: <Widget>[
customButton((){},Icons.filter,'Filter'),
customButton((){},Icons.filter,'Filter'),
customButton((){},Icons.filter,'Filter'),
],), preferredSize: Size.fromHeight(70)),
)
);
Scaffold(
appBar: AppBar(
title: AutoSizeText('Doctors List'),
bottom: PreferredSize(child: Row(children: <Widget>[
customButton((){},Icons.filter,'Filter'),
customButton((){},Icons.filter,'Filter'),
customButton((){},Icons.filter,'Filter'),
],), preferredSize: Size.fromHeight(70)),
)
);