-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content manager & featured listings #526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz don't merge until all my changes are in
handleItemClick( | ||
`/item/${listing.username}/${listing.slug || listing.id}`, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at some point we should move to having typed urls instead of string matching, since it is pretty error prone. like a route map
type RouteConfig = {
path: AppRoute;
component: React.FC;
};
const routes: RouteConfig[] = [
{ path: AppRoutes.Home, component: Home },
{ path: AppRoutes.Profile, component: Profile },
{ path: AppRoutes.Settings, component: Settings },
];
// Route rendering
import { Route, Routes } from "react-router-dom";
const AppRouter: React.FC = () => (
<Routes>
{routes.map(({ path, component: Component }) => (
<Route key={path} path={path} element={<Component />} />
))}
</Routes>
);
if (response.error) { | ||
addErrorAlert(response.error); | ||
} else { | ||
const newFeaturedState = !isFeatured; | ||
setIsFeatured(newFeaturedState); | ||
addAlert( | ||
`Listing ${newFeaturedState ? "featured" : "unfeatured"} successfully`, | ||
"success", | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is such a common pattern, i feel like there must be a way to do this better - should make an issue for this
mstm |
ref: #526 |
What does this PR do?
Added content manager role and featured listings
If this PR changes the UI, include a screenshot below.
No featured listings and featured button on post.
Content manager role