Revert to URLs without @
This commit is contained in:
parent
cda5810589
commit
022caa4407
|
@ -12,11 +12,10 @@ import { SEO } from './SEO'
|
|||
|
||||
export function UserLink(props: { displayName: string; className?: string }) {
|
||||
const { displayName, className } = props
|
||||
// Fix this when users can change their own names
|
||||
const username = displayName.replace(/\s+/g, '')
|
||||
|
||||
return (
|
||||
<Link href={`/@${username}`}>
|
||||
<Link href={`/${username}`}>
|
||||
<a
|
||||
className={clsx(
|
||||
'hover:underline hover:decoration-indigo-400 hover:decoration-2',
|
||||
|
|
|
@ -41,7 +41,7 @@ export function path(contract: Contract) {
|
|||
// For now, derive username from creatorName
|
||||
// Fix this when users can change their own names
|
||||
const username = contract.creatorName.replace(/\s+/g, '')
|
||||
return `/@${username}/${contract.id}`
|
||||
return `/${username}/${contract.id}`
|
||||
}
|
||||
|
||||
export function compute(contract: Contract) {
|
||||
|
|
|
@ -8,11 +8,8 @@ import { useUser } from '../../hooks/use-user'
|
|||
|
||||
export default function UserProfile() {
|
||||
const router = useRouter()
|
||||
const atUsername = router.query.username as string | undefined
|
||||
const username = atUsername?.substring(1) || '' // Remove the initial @
|
||||
|
||||
const [user, setUser] = useState<User | null | 'loading'>('loading')
|
||||
|
||||
const { username } = router.query as { username: string }
|
||||
useEffect(() => {
|
||||
if (username) {
|
||||
getUserByUsername(username).then(setUser)
|
||||
|
|
Loading…
Reference in New Issue
Block a user