mirror of
https://github.com/wassname/talk.git
synced 2026-07-27 11:28:12 +08:00
[next] Admin Configure (#2076)
* feat: Add RadioButton and CheckBox * feat: configure facebook and google auth * feat: configure sso, localAuth and displayName + some tests * test: add integration tests for configure auth * test: more integration tests * feat: add oidc support * test: add oidc integration test * feat: generate sso key initially * fix: import fetchQuery from correct package * fix: admin url * fix: set timezone to utc when testing * refactor: improve route config * fix: remove obsolete line * fix: clientMutationId increment * fix: oidc only create when enabled * fix: copy * test: update snapshots * feat: fixed graphql logging extension * Update src/locales/en-US/admin.ftl Co-Authored-By: cvle <vinh@wikiwi.io> * Apply suggestions from code review Co-Authored-By: cvle <vinh@wikiwi.io> * test: update snapshots * fix: change Local Auth to Email Authentication * fix: copy updates
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
.root {
|
||||
color: var(--palette-primary-main);
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: TextLink
|
||||
menu: UI Kit
|
||||
---
|
||||
|
||||
import { Playground, PropsTable } from 'docz'
|
||||
import TextLink from './TextLink.tsx'
|
||||
import HorizontalGutter from '../HorizontalGutter'
|
||||
|
||||
# TextLink
|
||||
|
||||
## Basic Use
|
||||
<Playground>
|
||||
<HorizontalGutter>
|
||||
<TextLink href="https://coralproject.net">Well... Hello there.</TextLink>
|
||||
</HorizontalGutter>
|
||||
</Playground>
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import React from "react";
|
||||
import TestRenderer from "react-test-renderer";
|
||||
|
||||
import { PropTypesOf } from "talk-ui/types";
|
||||
|
||||
import TextLink from "./TextLink";
|
||||
|
||||
it("renders correctly", () => {
|
||||
const props: PropTypesOf<typeof TextLink> = {
|
||||
className: "custom",
|
||||
};
|
||||
const renderer = TestRenderer.create(<TextLink {...props}>Hello</TextLink>);
|
||||
expect(renderer.toJSON()).toMatchSnapshot();
|
||||
});
|
||||
@@ -0,0 +1,31 @@
|
||||
import cn from "classnames";
|
||||
import React, { AnchorHTMLAttributes } from "react";
|
||||
import { StatelessComponent } from "react";
|
||||
import { withStyles } from "talk-ui/hocs";
|
||||
import styles from "./TextLink.css";
|
||||
|
||||
interface Props extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: typeof styles;
|
||||
}
|
||||
|
||||
const TextLinkProps: StatelessComponent<Props> = props => {
|
||||
const { className, children, classes, ...rest } = props;
|
||||
|
||||
const rootClassName = cn(classes.root, className);
|
||||
|
||||
return (
|
||||
<a
|
||||
className={rootClassName}
|
||||
href={props.href || (children as string)}
|
||||
{...rest}
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
const enhanced = withStyles(styles)(TextLinkProps);
|
||||
export default enhanced;
|
||||
@@ -0,0 +1,10 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders correctly 1`] = `
|
||||
<a
|
||||
className="TextLink-root custom"
|
||||
href="Hello"
|
||||
>
|
||||
Hello
|
||||
</a>
|
||||
`;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from "./TextLink";
|
||||
Reference in New Issue
Block a user