Skip to content

Commit

Permalink
feat(redirect): add redirect component
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerd Müller committed Jun 14, 2020
1 parent aec1f71 commit f42e872
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/data/src/lib/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum Layer {

export enum ContentType {
Text = "text",
Redirect = "redirect",
Video = "video",
Image = "image",
Game = "game",
Expand All @@ -23,11 +24,13 @@ export interface Content {
type: string
layer: string
value: string
title?: string
}

export interface Group {
grouped: boolean
row: boolean
background?: string
content: Content[]
}

Expand Down
1 change: 1 addition & 0 deletions libs/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './lib/redirect/redirect';
export * from './lib/scrollicon/scrollicon';
export * from './lib/puzzle/puzzle';
export * from './lib/smokingpit/smokingpit';
Expand Down
18 changes: 18 additions & 0 deletions libs/ui/src/lib/redirect/redirect.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.link-button {
background-color: transparent;
text-decoration: none;
color: var(--color-link);
border: none;
cursor: pointer;
display: inline;

&:hover,
&:focus {
color: var(--color-link-highlighted);
}

.redirect {
width: 75vw;
margin: auto;
}
}
11 changes: 11 additions & 0 deletions libs/ui/src/lib/redirect/redirect.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import { render } from '@testing-library/react';

import Redirect from './redirect';

describe(' Redirect', () => {
it('should render successfully', () => {
const { baseElement } = render(<Redirect />);
expect(baseElement).toBeTruthy();
});
});
16 changes: 16 additions & 0 deletions libs/ui/src/lib/redirect/redirect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';

import './redirect.scss';

/* eslint-disable-next-line */
export interface RedirectProps {
value: string
}

export const Redirect = (props: RedirectProps) => {
return (
<button type='button' className='link-button redirect'>{props.value}</button>
);
};

export default Redirect;

0 comments on commit f42e872

Please sign in to comment.