Skip to content

Commit

Permalink
Path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwf committed Apr 4, 2023
1 parent 2a854e8 commit cbf53da
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digirati-co-uk/ida-madoc-plugin",
"version": "0.0.6",
"version": "0.0.7",
"main": "dist/index.js",
"description": "Madoc plugin for IDA",
"license": "MIT",
Expand Down
56 changes: 56 additions & 0 deletions src/blocks/Btn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import * as React from 'react';
import styled from "styled-components";

export const Btn = styled.button<{ color?: string }>`
font-family: 'IBM Plex Sans', sans-serif;
font-weight: 500;
font-size: 16px;
color: ${(props) => (props.color ? props.color : '#002d4b')};
border: 1px solid;
border-color: ${(props) => (props.color ? props.color : '#002d4b')};
background-color: transparent;
border-radius: 20px;
padding: 10px;
:hover {
cursor: pointer;
background-color: #ECF5FC;
}
`;

export const TxtBtn = styled.button<{ color?: string }>`
font-family: 'IBM Plex Sans', sans-serif;
font-size: 12px;
color: ${(props) => (props.color ? props.color :'#002d4b')};
border: none;
border-radius: 20px;
padding: 10px;
background-color: transparent;
svg {
color: ${(props) => (props.color ? props.color : '#B1E0FF')};
height: 18px;
margin-right: 8px;
}
:hover {
cursor: pointer;
background-color: #ECF5FC;
text-decoration: underline;
}
`;

export type ButtonProps = {
color?: string;
onClick?: () => void;
children?: React.ReactNode;
ariaLabel?: string;
};

export const Button = (props: ButtonProps) => (
<Btn aria-label={props.ariaLabel} color={props.color}>
{props.children}
</Btn>
);
export const TextButton = (props: ButtonProps) => (
<TxtBtn aria-label={props.ariaLabel} color={props.color}>
{props.children}
</TxtBtn>
);
12 changes: 7 additions & 5 deletions src/blocks/custom-ida-nav/DropdownNav.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, { useState } from 'react';
import styled from 'styled-components';
import { blockEditorFor } from '@madoc.io/types/dist/extensions/page-blocks/block-editor-react';
import { GlobalSiteNavigation } from '@madoc.io/types/dist/frontend/site/features/GlobalSiteNavigation';
import { blockConfigFor } from '@madoc.io/types';
// @ts-ignore
import { GlobalSiteNavigation } from '@madoc.io/types';
import { useLocation } from 'react-router-dom';
import { useBrowserLayoutEffect } from '@madoc.io/types/dist/frontend/shared/hooks/use-browser-layout-effect';
// @ts-ignore
import { useBrowserLayoutEffect } from '@madoc.io/types';
import { Close } from '../../icons/close';

const DropdownMenuWrapper = styled.div``;
Expand Down Expand Up @@ -146,7 +148,7 @@ export const DropdownNav: React.FC<{
);
};

blockEditorFor(DropdownNav, {
blockConfigFor(DropdownNav, {
type: 'default.DropdownNav',
label: 'IDA Custom Dropdown Nav',
defaultProps: {
Expand Down Expand Up @@ -185,4 +187,4 @@ blockEditorFor(DropdownNav, {
if (formInput.slug3) newNavItems.push({ slug: formInput.slug3, text: formInput.text3 });
return { newNavItems };
},
});
});

0 comments on commit cbf53da

Please sign in to comment.