Skip to content
Snippets Groups Projects
Commit 45fe70b9 authored by mateusz-winiarczyk's avatar mateusz-winiarczyk
Browse files

feat(plugins): adjust styles plugins

parent d3463cdd
No related branches found
No related tags found
3 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!122feat: add main plugins drawer with tabs (MIN-232),!116feat(plugins): Plugin loading management (MIN-233)
Pipeline #85048 passed
import {
privateActivePluginsSelector,
publicPluginsListSelector,
} from '@/redux/plugins/plugins.selectors';
import { DrawerHeading } from '@/shared/DrawerHeading';
import { useSelector } from 'react-redux';
import { LoadPlugin } from './LoadPlugin';
import { LoadPluginFromUrl } from './LoadPluginFromUrl';
import { PublicPlugins } from './PublicPlugins';
import { PrivateActivePlugins } from './PrivateActivePlugins';
export const AvailablePluginsDrawer = (): JSX.Element => {
const publicPlugins = useSelector(publicPluginsListSelector);
const privateActivePlugins = useSelector(privateActivePluginsSelector);
return (
<div className="h-full max-h-full" data-testid="available-plugins-drawer">
<DrawerHeading title="Available plugins" />
<div className="flex flex-col gap-6 p-6">
<LoadPluginFromUrl />
{privateActivePlugins.map(plugin => (
<LoadPlugin key={plugin.hash} plugin={plugin} />
))}
{publicPlugins.map(plugin => (
<LoadPlugin key={plugin.hash} plugin={plugin} />
))}
<PrivateActivePlugins />
<PublicPlugins />
</div>
</div>
);
......
......@@ -14,11 +14,11 @@ export const LoadPlugin = ({ plugin }: Props): JSX.Element => {
});
return (
<div className="flex w-full items-center justify-between">
<div className="flex w-full items-center justify-between text-sm">
<span className="text-cetacean-blue">{plugin.name}</span>
<Button
variantStyles="secondary"
className="h-10 self-end rounded-e rounded-s"
className="h-10 self-end rounded-e rounded-s text-xs font-medium"
onClick={togglePlugin}
data-testid="toggle-plugin"
disabled={isPluginLoading}
......
import { Button } from '@/shared/Button';
import { Input } from '@/shared/Input';
import { useLoadPluginFromUrl } from './hooks/useLoadPluginFromUrl';
export const LoadPluginFromUrl = (): JSX.Element => {
......@@ -8,8 +9,8 @@ export const LoadPluginFromUrl = (): JSX.Element => {
<div className="flex w-full">
<label className="flex w-full flex-col gap-2 text-sm text-cetacean-blue">
<span>URL:</span>
<input
className="h-10 w-full bg-cultured p-3"
<Input
className="h-10 w-full flex-none bg-cultured p-3"
type="url"
value={pluginUrl}
onChange={handleChangePluginUrl}
......@@ -18,7 +19,7 @@ export const LoadPluginFromUrl = (): JSX.Element => {
</label>
<Button
variantStyles="secondary"
className="h-10 self-end rounded-e rounded-s"
className="h-10 self-end rounded-e rounded-s text-xs font-medium"
onClick={handleLoadPlugin}
disabled={isPending}
data-testid="load-plugin-button"
......
import { privateActivePluginsSelector } from '@/redux/plugins/plugins.selectors';
import { useSelector } from 'react-redux';
import { LoadPlugin } from '../LoadPlugin';
export const PrivateActivePlugins = (): React.ReactNode => {
const privateActivePlugins = useSelector(privateActivePluginsSelector);
return privateActivePlugins.map(plugin => <LoadPlugin key={plugin.hash} plugin={plugin} />);
};
export { PrivateActivePlugins } from './PrivateActivePlugins.component';
import { publicPluginsListSelector } from '@/redux/plugins/plugins.selectors';
import React from 'react';
import { useSelector } from 'react-redux';
import { LoadPlugin } from '../LoadPlugin';
export const PublicPlugins = (): React.ReactNode => {
const publicPlugins = useSelector(publicPluginsListSelector);
return publicPlugins.map(plugin => <LoadPlugin key={plugin.hash} plugin={plugin} />);
};
export { PublicPlugins } from './PublicPlugins.component';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment