Skip to content

Instantly share code, notes, and snippets.

View biancadragomir's full-sized avatar

Bianca Dragomir biancadragomir

View GitHub Profile
@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'
}
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./src/assets/fonts/'],
};
const Popup = () => {
...
const handleClose = () => {
props.closePopup();
}
return (
<ClickAwayListener onClickAway={handleClose}>
{renderPopupContent()}
...
type Props = {
const isPopupOpen: boolean;
const closePopup: () => void;
}
const Popup = (props: Props) => {
...
import React from 'react';
const INFINITE_SCROLL_ID = "infiniteScrollId";
const Root = () => {
return <Grid
container
direction="column"
id={INFINITE_SCROLL_ID}
onScroll={onScroll}
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]);
export const home = '/home';
export const spaceships = '/spaceships';
// ...
import { AppBar, Grid, Hidden, Toolbar } from '@material-ui/core';
// ...
const Header = () => {
// ...
return (
<AppBar position="static">
<Toolbar disableGutters>
import { makeStyles } from '@material-ui/core';
export const useStyles = makeStyles((theme) => ({
bottomNavigation: {
position: 'sticky',
paddingLeft: 16,
paddingRight: 16,
bottom: 0,
// ...
}
import {
BottomNavigation,
BottomNavigationAction,
Hidden,
} from '@material-ui/core';
import Drawer from '../../../../src/app/Drawer';
import * as routes from '../../../app/routes';
import { useTranslation } from 'react-i18next';
import { useStyles } from './styles';
import { useHistory } from 'react-router-dom';