feat: oidc config
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
// import React from 'react'
|
||||
import styled from "styled-components";
|
||||
import Input from "../../../common/component/styled/Input";
|
||||
import Toggle from "../../../common/component/styled/Toggle";
|
||||
import IconPlus from "../../../assets/icons/plus.circle.svg";
|
||||
import IconMinus from "../../../assets/icons/minus.circle.svg";
|
||||
const Styled = styled.div`
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
.issuers {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
.issuer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
justify-content: space-between;
|
||||
.remove {
|
||||
cursor: pointer;
|
||||
}
|
||||
.icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.url {
|
||||
width: 342px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.add {
|
||||
cursor: pointer;
|
||||
}
|
||||
`;
|
||||
export default function IssuerList() {
|
||||
return (
|
||||
<Styled>
|
||||
<ul className="issuers">
|
||||
<li className="issuer">
|
||||
<div className="left">
|
||||
<IconMinus className="remove" />
|
||||
<img
|
||||
src="https://static.nicegoodthings.com/project/ext/webrowse.logo.png"
|
||||
alt="logo"
|
||||
className="icon"
|
||||
/>
|
||||
<Input
|
||||
prefix="https://"
|
||||
placeholder="Issuer Domain"
|
||||
className="url"
|
||||
/>
|
||||
</div>
|
||||
<div className="right">
|
||||
<Toggle />
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<IconPlus className="add" />
|
||||
</Styled>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import { useState } from "react";
|
||||
import Select from "../../../../common/component/styled/Select";
|
||||
import Button from "../../../../common/component/styled/Button";
|
||||
import Input from "../../../../common/component/styled/Input";
|
||||
import Toggle from "../../../../common/component/styled/Toggle";
|
||||
import options from "./items.json";
|
||||
import Styled from "./styled";
|
||||
// import IconPlus from "../../../../assets/icons/plus.circle.svg";
|
||||
import IconMinus from "../../../../assets/icons/minus.circle.svg";
|
||||
|
||||
export default function IssuerList({ issuers = [] }) {
|
||||
const [select, setSelect] = useState(undefined);
|
||||
const [newDomain, setNewDomain] = useState("");
|
||||
const handleNewDomain = (evt) => {
|
||||
setNewDomain(evt.target.value);
|
||||
};
|
||||
const disableBtn = !(newDomain || !!select?.value);
|
||||
return (
|
||||
<Styled>
|
||||
<ul className="issuers">
|
||||
{issuers.map(({ enable, favicon, domain }) => {
|
||||
return (
|
||||
<li key={domain} className="issuer">
|
||||
<div className="left">
|
||||
<IconMinus className="remove" />
|
||||
<div className="data">
|
||||
<img src={favicon} alt="logo" className="icon" />
|
||||
<Input
|
||||
readOnly
|
||||
value={domain}
|
||||
prefix="https://"
|
||||
placeholder="Issuer Domain"
|
||||
className="url"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="right">
|
||||
<Toggle data-checked={enable} />
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
|
||||
<li className="issuer add">
|
||||
<div className="left">
|
||||
<Select options={options} updateSelect={setSelect} />
|
||||
<div className="data">
|
||||
<Input
|
||||
onChange={handleNewDomain}
|
||||
readOnly={!!select?.value}
|
||||
value={select?.value || newDomain}
|
||||
prefix="https://"
|
||||
placeholder="domain.com"
|
||||
className="url"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="right">
|
||||
<Button disabled={disableBtn}>Add</Button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
{/* <IconPlus className="add" /> */}
|
||||
</Styled>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"title": "Facebook",
|
||||
"value": "facebook.com",
|
||||
"icon": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXd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NS45OTk4SDkuNDM2NzdWMjAuNjI1OUgxMy41MDA0VjMxLjgwNjRDMTQuMzE0OSAzMS45MzQ0IDE1LjE0OTYgMzEuOTk5OCAxNi4wMDAxIDMxLjk5OThDMTYuODUwNyAzMS45OTk4IDE3LjY4NTQgMzEuOTMyMiAxOC40OTk5IDMxLjgwNjRWMjAuNjI1OUgyMi4yMjgyTDIyLjIyOCAyMC42MjU4WiIgZmlsbD0iI0ZFRkVGRSIvPgo8L3N2Zz4K",
|
||||
"selected": true
|
||||
},
|
||||
{
|
||||
"title": "Github",
|
||||
"value": "github.com",
|
||||
"disabled": true,
|
||||
"underline": true
|
||||
},
|
||||
{
|
||||
"title": "Custom",
|
||||
"value": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,52 @@
|
||||
import styled from "styled-components";
|
||||
const Styled = styled.div`
|
||||
padding: 16px 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
.issuers {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
.issuer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 40px;
|
||||
.left {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
justify-content: space-between;
|
||||
.remove {
|
||||
cursor: pointer;
|
||||
}
|
||||
.data {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 16px;
|
||||
justify-content: space-between;
|
||||
> .icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
> .url {
|
||||
width: 280px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.right {
|
||||
width: 56px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
.add {
|
||||
cursor: pointer;
|
||||
}
|
||||
`;
|
||||
|
||||
export default Styled;
|
||||
@@ -117,7 +117,7 @@ export default function Logins() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="row">
|
||||
<IssuerList />
|
||||
<IssuerList issuers={oidc} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user