Skip to content

Commit

Permalink
Grid style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Sep 27, 2022
1 parent f986fa2 commit d02fb6d
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 28 deletions.
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"@types/lodash": "^4.14.185",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@types/react-virtualized-auto-sizer": "^1.0.1",
Expand Down Expand Up @@ -78,6 +79,7 @@
"freedesktop-icons": "^1.0.0",
"fuse.js": "^6.6.2",
"glasstron": "^0.1.1",
"lodash": "^4.17.21",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.7",
"winston": "^3.8.1",
Expand Down
8 changes: 7 additions & 1 deletion src/bangs/wikipedia.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EmptyBangResponse, IBang, InfoboxBangResponse } from "./bangs";
import upperFirst from "lodash/upperFirst";

type WikipediaResponse = {
query: {
Expand Down Expand Up @@ -29,7 +30,12 @@ export class WikipediaBang
async onActivate(
input: string
): Promise<InfoboxBangResponse | EmptyBangResponse> {
const query = input.replace("!w", "").trim();
const query = input
.replace("!w", "")
.trim()
.split(" ")
.map(upperFirst)
.join(" ");
const url = `https://en.wikipedia.org/w/api.php?action=query&prop=extracts|pageimages|pageprops&format=json&exintro=&explaintext=&titles=${query}&pithumbsize=300`;
const result = (await (await fetch(url)).json()) as WikipediaResponse;

Expand Down
4 changes: 2 additions & 2 deletions src/components/BangsArea/BangsArea.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.bangs-area {
@apply flex justify-center items-center w-full rounded-xl bg-black/20 transition-all duration-500;
@apply mt-4 p-8;
@apply flex justify-center items-center rounded-xl bg-black/20 transition-all duration-500;
@apply m-4 p-8;

&.empty {
@apply h-0 p-0 m-0;
Expand Down
7 changes: 2 additions & 5 deletions src/components/Input/Input.module.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.inputWrapper {
@apply flex flex-row items-center;
@apply border border-solid border-slate-600/50;
@apply focus-within:ring-blue-500 focus-within:border-blue-500;
@apply rounded-lg;
@apply transition-colors duration-200 ease-in-out;
@apply flex flex-row items-center px-4 py-2;
@apply border-b border-slate-700;
}

.prefixLabel {
Expand Down
5 changes: 1 addition & 4 deletions src/components/Palette/Palette.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.palette {
@apply flex flex-col;
@apply p-8;
@apply outline-none;
@apply h-full;
@apply flex flex-col outline-none h-full;
}
2 changes: 0 additions & 2 deletions src/components/PaletteGrid/PaletteGrid.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
}

.palette-grid-list {
@apply pr-2;

& > div {
@apply relative;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/PaletteGrid/PaletteGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type PaletteGridProps = {
itemSizeWithDescription?: number;
};

const ITEM_SIZE = 28;
const ITEM_SIZE_WITH_DESCRIPTION = 40;
const ITEM_SIZE = 32;
const ITEM_SIZE_WITH_DESCRIPTION = 44;

export const PaletteGrid: React.FC<PaletteGridProps> = ({
items,
Expand Down
3 changes: 1 addition & 2 deletions src/components/PaletteItem/PaletteItem.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.palette-item {
@apply flex flex-row items-center;
@apply w-full;
@apply px-3 py-2;
@apply px-6 py-4;
@apply hover:bg-slate-600/50 focus:bg-slate-600/50 active:bg-slate-500/50;
@apply cursor-pointer;
@apply outline-none;
Expand All @@ -10,7 +10,6 @@
@apply whitespace-nowrap;
@apply text-ellipsis;
@apply overflow-ellipsis;
@apply rounded-lg;

& > *:not(:last-child) {
@apply mr-1;
Expand Down

0 comments on commit d02fb6d

Please sign in to comment.