fix: added BASE_URL support
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Link } from 'preact-router/match'
|
||||
import { isAdministrator, User, UserRole } from '../../shared/model'
|
||||
import { prependBaseUrl } from '../api'
|
||||
|
||||
const ROLE_LABEL: Record<UserRole, string> = {
|
||||
['admin']: 'Admin',
|
||||
@@ -15,7 +16,7 @@ type Props = {
|
||||
export const Header = ({ user, noLogin }: Props) => (
|
||||
<header>
|
||||
<div class="logo">
|
||||
<a href="/">PHC / Problemi</a>
|
||||
<a href={prependBaseUrl('/')}>PHC / Problemi</a>
|
||||
</div>
|
||||
<nav>
|
||||
{user ? (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { prependBaseUrl } from '../api'
|
||||
import { Markdown } from './Markdown'
|
||||
|
||||
type Props = {
|
||||
@@ -11,7 +12,7 @@ export const Problem = ({ id, content, solutionsCount }: Props) => {
|
||||
<div class="problem">
|
||||
<div class="problem-header">
|
||||
<div class="problem-title">
|
||||
<a href={`/problem/${id}`}>Problema {id}</a>
|
||||
<a href={prependBaseUrl(`/problem/${id}`)}>Problema {id}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="problem-content">
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
SolutionStatus,
|
||||
UserId,
|
||||
} from '../../shared/model'
|
||||
import { server } from '../api'
|
||||
import { prependBaseUrl, server } from '../api'
|
||||
import { Markdown } from './Markdown'
|
||||
import { Select } from './Select'
|
||||
|
||||
@@ -89,13 +89,14 @@ export const Solution = ({
|
||||
{sentBy && (
|
||||
<>
|
||||
{' '}
|
||||
di <a href={`/user/${sentBy}`}>@{sentBy}</a>
|
||||
di <a href={prependBaseUrl(`/user/${sentBy}`)}>@{sentBy}</a>
|
||||
</>
|
||||
)}
|
||||
{forProblem && (
|
||||
<>
|
||||
{' '}
|
||||
per il <a href={`/problem/${forProblem}`}>Problema {forProblem}</a>
|
||||
per il{' '}
|
||||
<a href={prependBaseUrl(`/problem/${forProblem}`)}>Problema {forProblem}</a>
|
||||
</>
|
||||
)}
|
||||
{!isNaN(d as any) && (
|
||||
|
||||
Reference in New Issue
Block a user