Skip to content

Commit 04190cb

Browse files
authored
fix(ui): providers responsiveness (#589)
1 parent b6937df commit 04190cb

File tree

4 files changed

+26
-101
lines changed

4 files changed

+26
-101
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.tile-basis {
2+
flex-basis: calc(14.285% - 1.25rem);
3+
}
4+
5+
@media only screen and (max-width: 600px) {
6+
/* For mobile phones: */
7+
.tile-basis {
8+
flex-basis: calc(100% - 1.25rem);
9+
}
10+
}
11+
12+
@media only screen and (min-width: 600px) and (max-width: 1024px) {
13+
.tile-basis {
14+
flex-basis: calc(33.333333% - 1.25rem);
15+
}
16+
}
17+
18+
@media only screen and (min-width: 1024px) and (max-width: 2048px) {
19+
.tile-basis {
20+
flex-basis: calc(25% - 1.25rem);
21+
}
22+
}

keep-ui/app/providers/provider-tile.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import {
2-
Badge,
3-
Button,
4-
Icon,
5-
Subtitle,
6-
Text,
7-
Title,
8-
} from "@tremor/react";
1+
import { Badge, Button, Icon, Subtitle, Text, Title } from "@tremor/react";
92
import { Provider } from "./providers";
103
import Image from "next/image";
114
import {
@@ -15,6 +8,7 @@ import {
158
QueueListIcon,
169
TicketIcon,
1710
} from "@heroicons/react/20/solid";
11+
import "./provider-tile.css";
1812

1913
interface Props {
2014
provider: Provider;
@@ -67,7 +61,7 @@ const OAuthIcon = (props: any) => (
6761
export default function ProviderTile({ provider, onClick }: Props) {
6862
return (
6963
<div
70-
className="relative flex-grow group flex justify-around items-center bg-white rounded-lg shadow w-80 max-w-xs h-44 hover:shadow-lg hover:grayscale-0 cursor-pointer"
64+
className="tile-basis relative group flex justify-around items-center bg-white rounded-lg shadow h-44 hover:shadow-lg hover:grayscale-0 cursor-pointer"
7165
onClick={onClick}
7266
>
7367
<div className="w-32">

keep-ui/app/providers/providers-tiles.css

Lines changed: 0 additions & 90 deletions
This file was deleted.

keep-ui/app/providers/providers-tiles.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useEffect, useState } from "react";
55
import SlidingPanel from "react-sliding-side-panel";
66
import ProviderForm from "./provider-form";
77
import ProviderTile from "./provider-tile";
8-
import "./providers-tiles.css";
98
import "react-sliding-side-panel/lib/index.css";
109
import { useSearchParams } from "next/navigation";
1110
import { hideOrShowIntercom } from "@/components/ui/Intercom";
@@ -112,7 +111,7 @@ const ProvidersTiles = ({
112111
<Title className="mb-2.5">
113112
{installedProvidersMode ? "Installed Providers" : "Available Providers"}
114113
</Title>
115-
<div className="provider-tiles mb-5">
114+
<div className="flex flex-wrap mb-5 gap-5">
116115
{providersWithConfig.map((provider, index) => (
117116
<ProviderTile
118117
key={provider.id}

0 commit comments

Comments
 (0)