|
|
@@ -1,12 +1,14 @@
|
|
|
// import { faCircleArrowDown, faCircleCheck } from '@fortawesome/free-solid-svg-icons';
|
|
|
// import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
-import { useState } from 'react';
|
|
|
+import { useCallback, useState } from 'react';
|
|
|
|
|
|
import Image from 'next/image';
|
|
|
import Link from 'next/link';
|
|
|
|
|
|
import { SearchResultItem } from '~/models/SearchResultItem';
|
|
|
|
|
|
+import styles from './PluginCard.module.scss';
|
|
|
+
|
|
|
|
|
|
type Props = {
|
|
|
name: string,
|
|
|
@@ -14,27 +16,19 @@ type Props = {
|
|
|
description: string,
|
|
|
}
|
|
|
|
|
|
-export const PluginCard = (props: Props) => {
|
|
|
- // const {
|
|
|
- // name, fullName, description, htmlUrl, topics, stargazersCount, owner,
|
|
|
- // } = props;
|
|
|
+export const PluginCard = (props: Props): JSX.Element => {
|
|
|
const {
|
|
|
name, url, description,
|
|
|
} = props;
|
|
|
- const [isEnabled, setIsEnabled] = useState(true);
|
|
|
+ // const [isEnabled, setIsEnabled] = useState(true);
|
|
|
|
|
|
- const updateCheckboxHandler = (event: { target: { checked: boolean }; }) => {
|
|
|
- if (isEnabled === true) {
|
|
|
- setIsEnabled(true);
|
|
|
- }
|
|
|
- else {
|
|
|
- setIsEnabled(false);
|
|
|
- }
|
|
|
- };
|
|
|
+ // const checkboxHandler = useCallback(() => {
|
|
|
+ // setIsEnabled(false);
|
|
|
+ // }, []);
|
|
|
|
|
|
return (
|
|
|
<div className="card shadow border-0" key={name}>
|
|
|
- <div className="card-body px-5 py-4">
|
|
|
+ <div className="card-body px-5 py-4 mt-3">
|
|
|
<div className="row mb-3">
|
|
|
<div className="col-9">
|
|
|
<h2 className="card-title h3 border-bottom pb-2 mb-3">
|
|
|
@@ -42,16 +36,25 @@ export const PluginCard = (props: Props) => {
|
|
|
</h2>
|
|
|
<p className="card-text text-muted">{description}</p>
|
|
|
</div>
|
|
|
- <div className="col-3">
|
|
|
- <div className="custom-control custom-switch custom-switch-lg custom-switch-slack">
|
|
|
+ <div className='col-3'>
|
|
|
+ <div className={`${styles.plugin_card}`}>
|
|
|
+ <div className="switch">
|
|
|
+ <label className="switch__label">
|
|
|
+ <input type="checkbox" className="switch__input" checked/>
|
|
|
+ <span className="switch__content"></span>
|
|
|
+ <span className="switch__circle"></span>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ {/* <div className="custom-control custom-switch custom-switch-lg custom-switch-slack">
|
|
|
<input
|
|
|
type="checkbox"
|
|
|
className="custom-control-input border-0"
|
|
|
checked={isEnabled}
|
|
|
- onChange={updateCheckboxHandler}
|
|
|
+ onChange={checkboxHandler}
|
|
|
/>
|
|
|
<label className="custom-control-label align-center"></label>
|
|
|
- </div>
|
|
|
+ </div> */}
|
|
|
{/* <Image className="mx-auto" alt="GitHub avator image" src={owner.avatar_url} width={250} height={250} /> */}
|
|
|
</div>
|
|
|
</div>
|