chore: Move remaining auth methods to plugins (#4900)
* Move Google, Email, and Azure to plugins * Move OIDC provider, remove old loading code * Move AuthLogo to plugin * AuthLogo -> PluginIcon * Lazy load plugin settings
This commit is contained in:
35
app/components/PluginIcon.tsx
Normal file
35
app/components/PluginIcon.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import PluginLoader from "~/utils/PluginLoader";
|
||||
|
||||
type Props = {
|
||||
id: string;
|
||||
size?: number;
|
||||
color?: string;
|
||||
};
|
||||
|
||||
function PluginIcon({ id, color, size = 24 }: Props) {
|
||||
const plugin = PluginLoader.plugins[id];
|
||||
const Icon = plugin?.icon;
|
||||
|
||||
if (Icon) {
|
||||
return (
|
||||
<Wrapper>
|
||||
<Icon size={size} fill={color} />
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const Wrapper = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
`;
|
||||
|
||||
export default PluginIcon;
|
||||
Reference in New Issue
Block a user