Skip to content

Instantly share code, notes, and snippets.

View biancadragomir's full-sized avatar

Bianca Dragomir biancadragomir

View GitHub Profile
import { AppBar, Grid, Hidden, Toolbar } from '@material-ui/core';
// ...
const Header = () => {
// ...
return (
<AppBar position="static">
<Toolbar disableGutters>
export const home = '/home';
export const spaceships = '/spaceships';
// ...
import { useEffect } from 'react';
export const useOnScrollEffect = (
fun: React.EffectCallback,
elementId: string
) =>
useEffect(() => {
document.getElementById(elementId)?.addEventListener('scroll', fun);
return () => window.removeEventListener('scroll', fun);
}, [fun]);
import React from 'react';
const INFINITE_SCROLL_ID = "infiniteScrollId";
const Root = () => {
return <Grid
container
direction="column"
id={INFINITE_SCROLL_ID}
onScroll={onScroll}
...
type Props = {
const isPopupOpen: boolean;
const closePopup: () => void;
}
const Popup = (props: Props) => {
...
const Popup = () => {
...
const handleClose = () => {
props.closePopup();
}
return (
<ClickAwayListener onClickAway={handleClose}>
{renderPopupContent()}
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./src/assets/fonts/'],
};
@biancadragomir
biancadragomir / build.gradle
Created April 2, 2023 08:05
How to enable resource shrinking in your Android project
android {
...
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles
getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}