Skip to content

Commit

Permalink
better naming for Link + styling admin area
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Jul 21, 2021
1 parent 796e5d0 commit 8f1c28b
Show file tree
Hide file tree
Showing 7 changed files with 405 additions and 349 deletions.
7 changes: 5 additions & 2 deletions packages/@vulcanjs/next-material-ui/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ type LinkProps = NextLinkProps &
MuiLinkProps<"a", NextComposedProps> &
BaseLinkProps;

// A styled version of the Next.js Link component:
// https://nextjs.org/docs/#with-link
/**
* Material UI Link + Next Link + an <a> anchor
*
* Use as a replacement for Material UI Link in Next.js applications
*/
const Link: React.FC<LinkProps> = (props) => {
const {
href,
Expand Down
1 change: 1 addition & 0 deletions packages/@vulcanjs/next-material-ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export { default as useMuiApp } from "./useMuiApp";
export * from "./getMuiDocumentInitialProps";

export { default as Link } from "./components/Link";
export { default as NextMuiLink } from "./components/Link"; // recommanded alias to use
24 changes: 24 additions & 0 deletions src/components/vns/ItemCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* TODO: in Vulcan Meteor we already have a Card component, we will need to make it
* available in Vulcan NPM as well
*
* This component will be removed when this is done
*/

import { getReadableFields } from "@vulcanjs/schema";

export const ItemCard = ({ document, model }) => {
const readableFields = getReadableFields(model.schema);
return (
<div>
{readableFields.map((field) =>
document[field] ? (
<p key={document._id + field}>
{" "}
<strong>{field}:</strong> {document[field]}{" "}
</p>
) : null
)}
</div>
);
};
Loading

0 comments on commit 8f1c28b

Please sign in to comment.