BlueprintB
Blueprint7mo ago
6 replies
! Iron Max

Adding additional routes to client side

fqdn/account/tickets works
fqdn/account/tickets/<somestuff> doesnt work
import React from 'react';
import { Switch, Route, useRouteMatch } from 'react-router-dom';
import TicketSection from '@/blueprint/extensions/{identifier}/sections/TicketSection';
import testpage from '@/blueprint/extensions/{identifier}/sections/TicketConv';


const TicketRouter: React.FC = () => {
    const { path } = useRouteMatch();
    console.log('Matched path:', path);

    return (
        <Switch>
            {/* List all tickets */}
            <Route exact path={path} component={TicketSection} />
            {/* View a specific ticket */}
            <Route path={`${path}/:ticketId([\\w-]+)`} component={testpage} />
        </Switch>
    );
};

export default TicketRouter;

# Template configuration files generally contain the minimum amount of
# options required for functionality. Learn more about options that are
# not listed here on the documentation page linked below.
#
# https://blueprint.zip/docs/?page=documentation/componentsyml

Navigation:
  NavigationBar: 
    AdditionalItems: "elements/NavItem"
  Routes:
    - { Name: "Ticket", Path: "/tickets", Type: "account", Component: "router/TicketRouter", AdminOnly: "false" }
Was this page helpful?