app: Mobile grid improvements
This commit is contained in:
@@ -46,6 +46,24 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 536px) {
|
||||||
|
.grid-container {
|
||||||
|
padding: 32px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-item {
|
||||||
|
width: 108px;
|
||||||
|
height: unset;
|
||||||
|
padding: 4px 0;
|
||||||
|
justify-content: flex-start;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-item p {
|
||||||
|
padding: 0 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.info-box {
|
.info-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -64,6 +82,10 @@
|
|||||||
.icon-usage {
|
.icon-usage {
|
||||||
padding-left: 10% !important;
|
padding-left: 10% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.snippet pre {
|
||||||
|
padding: 12px 8px 12px 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-preview {
|
.icon-preview {
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
import { useWindowSize } from "react-use";
|
import { useWindowSize } from "react-use";
|
||||||
|
|
||||||
|
const MOBILE_BREAKPOINT = 536;
|
||||||
|
|
||||||
const GRID_PADDING = 32; // .grid-container { padding }
|
const GRID_PADDING = 32; // .grid-container { padding }
|
||||||
const TOOLBAR_WIDTH = 17; // IS THIS BROWSER-SPECIFIC?
|
const TOOLBAR_WIDTH = 17; // IS THIS BROWSER-SPECIFIC?
|
||||||
const MAX_GRID_WIDTH = 1120; // .grid { max-width }
|
const MAX_GRID_WIDTH = 1120; // .grid { max-width }
|
||||||
const ITEM_WIDTH = 168; // .grid-item { width; height; margin }
|
const ITEM_WIDTH = 168; // .grid-item { width; height; margin }
|
||||||
|
const ITEM_WIDTH_MOBILE = 108; // .grid-item { width; height; margin }
|
||||||
|
|
||||||
export default (): number => {
|
export default (): number => {
|
||||||
const { width } = useWindowSize();
|
const { width } = useWindowSize();
|
||||||
|
const itemWidth = width <= MOBILE_BREAKPOINT ? ITEM_WIDTH_MOBILE : ITEM_WIDTH;
|
||||||
|
|
||||||
return Math.floor(
|
return Math.floor(
|
||||||
Math.min(width - GRID_PADDING - TOOLBAR_WIDTH, MAX_GRID_WIDTH) / ITEM_WIDTH
|
Math.min(width - GRID_PADDING - TOOLBAR_WIDTH, MAX_GRID_WIDTH) / itemWidth
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6393,12 +6393,12 @@ export const icons: ReadonlyArray<IconEntry> = [
|
|||||||
tags: ["attachments", "mail", "email", "office"],
|
tags: ["attachments", "mail", "email", "office"],
|
||||||
Icon: Icons.PaperclipHorizontal,
|
Icon: Icons.PaperclipHorizontal,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: "party-hat",
|
// name: "party-hat",
|
||||||
categories: [IconCategory.OBJECT],
|
// categories: [IconCategory.OBJECT],
|
||||||
tags: ["*new*", "birthday", "celebration", "event"],
|
// tags: ["*new*", "birthday", "celebration", "event"],
|
||||||
Icon: Icons.PartyHat,
|
// Icon: Icons.PartyHat,
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// name: "password",
|
// name: "password",
|
||||||
// categories: [IconCategory.SYSTEM],
|
// categories: [IconCategory.SYSTEM],
|
||||||
|
|||||||
Reference in New Issue
Block a user