Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #244 from smartive-education/feature/textbox-user
Browse files Browse the repository at this point in the history
fix: add props for user
  • Loading branch information
tomschall authored Mar 14, 2023
2 parents 60b8ccf + 53aaa57 commit d94e928
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IconLink } from '../link/IconLink';
import Link from 'next/link';

export interface ITextBoxProps {
user?: Pick<UserProps, 'label' | 'avatar'>;
user?: Pick<UserProps, 'label' | 'avatar'> & { username: string; href: string };
form: Pick<IFormInputProps, 'name' | 'placeholder' | 'errorMessage'>;
inputValue: string;
setInputValue: React.Dispatch<React.SetStateAction<string>>;
Expand All @@ -27,11 +27,8 @@ export const TextBox: React.FC<ITextBoxProps> = ({
startParagraph = 'Schreib deinen ersten Mumble, oder folge einem User',
user = {
label: 'Display Name',
username: {
label: 'Username',
href: '#',
type: 'username',
},
username: 'Username',
href: '/',
avatar: {
src: 'https://media.giphy.com/media/cfuL5gqFDreXxkWQ4o/giphy.gif',
alt: 'Alter Tag',
Expand Down Expand Up @@ -85,10 +82,10 @@ export const TextBox: React.FC<ITextBoxProps> = ({
{variant === 'write' && (
<User avatar={user.avatar} label={user.label} variant="write">
<IconLink
label="User"
label={user.username}
type="username"
color="violet"
href="/profilepage"
href={user.href}
legacyBehavior
passHref
linkComponent={Link}
Expand All @@ -98,10 +95,10 @@ export const TextBox: React.FC<ITextBoxProps> = ({
{variant === 'inline' && (
<User avatar={user.avatar} label={user.label} variant="inline">
<IconLink
label="User"
label={user.username}
type="username"
color="violet"
href="/profilepage"
href={user.href}
legacyBehavior
passHref
linkComponent={Link}
Expand Down

0 comments on commit d94e928

Please sign in to comment.