diff --git a/src/components/Banner/Banner.js b/src/components/Banner/Banner.js index fd25b16..7d8b2d3 100644 --- a/src/components/Banner/Banner.js +++ b/src/components/Banner/Banner.js @@ -1,6 +1,5 @@ import React from "react" import MarkdownView from "react-showdown" -//import ReactMarkdown from "react-markdown" import Lottie from "react-lottie" import { useTheme } from "../../context/themeContext" import "./Banner.scss" @@ -33,7 +32,6 @@ const Banner = ({ data }) => {
- {/* {variant === "hero" ?

{title}

:

{title}

} */} {showTitle()} { { dangerouslySetInnerHTML={{ __html: summary }} /> } - + {button && ( + + )}
diff --git a/src/components/BannerHead/BannerHead.js b/src/components/BannerHead/BannerHead.js deleted file mode 100644 index 284757c..0000000 --- a/src/components/BannerHead/BannerHead.js +++ /dev/null @@ -1,61 +0,0 @@ -import React from "react" -import "./BannerHead.scss" -import MarkdownView from "react-showdown" -import { getImage, GatsbyImage } from "gatsby-plugin-image" -import { useTheme } from "../../context/themeContext" -import PropTypes from 'prop-types' - -const BannerHead = ({ data }) => { - const { theme } = useTheme() - - const title = data?.title - - const checkImage = () => { - if (data?.image?.url) { - return ( - {data?.image?.name} - ) - } else { - const image = getImage(data?.image?.localFile) - const imageDark = data?.imageDark && getImage(data?.imageDark?.localFile) - return ( - - ) - } - } - - return ( -
-
{checkImage()}
- {title && } -
- ) -} - -BannerHead.propTypes = { - data: PropTypes.shape({ - title: PropTypes.string.isRequired, - image: PropTypes.shape({ - url: PropTypes.string, - name: PropTypes.string, - localFile: PropTypes.object, - }), - imageDark: PropTypes.shape({ - url: PropTypes.string, - localFile: PropTypes.object, - }) - }) - -} - -export default BannerHead diff --git a/src/components/BannerHead/BannerHead.scss b/src/components/BannerHead/BannerHead.scss deleted file mode 100644 index 9009e4c..0000000 --- a/src/components/BannerHead/BannerHead.scss +++ /dev/null @@ -1,50 +0,0 @@ -@import "../../styles/global.scss"; -//Pase todos los estilos de PageJobs, cuando este definido el estilo de la pag join-us lo cambiamos - -.banner { - width: 100%; - min-height: 300px; - align-items: center; - color: $primary; - h3 { - color: $primary; - text-align: center; - - span { - background-color: $primary; - display: inline-block; - -webkit-transform: skew(-15deg); - transform: skew(-15deg); - - h3 { - padding: 5px 20px; - -webkit-transform: skew(15deg); - transform: skew(15deg); - color: $white !important; - margin: 0; - } - } - } - h6 { - color: $primary; - //border-bottom: 4px solid $blue; - //padding: 7px; - text-align: center; - //padding: 0px 15px; - } -} - -.cats-mobile { - &-column-name { - font-size: $small; - } -} - -@media (min-width: $breakpoint-md) { - .banner { - h6 { - border-bottom: 4px solid $primary !important; - padding: 7px; - } - } -} diff --git a/src/components/BannerList/BannerList.js b/src/components/BannerList/BannerList.js index f432642..d5421ac 100644 --- a/src/components/BannerList/BannerList.js +++ b/src/components/BannerList/BannerList.js @@ -15,7 +15,7 @@ export default function BannerList({ data }) {
{ if (!image) return null - const { url, localFile } = image + const localImage = getImage(localFile?.childImageSharp?.gatsbyImageData) - if (localFile) { - const localImage = getImage(localFile?.childImageSharp?.gatsbyImageData) - + if (localImage) { return ( { ) } -OneSection.protoTypes = { +OneSection.propTypes = { data: PropTypes.shape({ dualSectionPart: PropTypes.arrayOf( PropTypes.shape({ diff --git a/src/components/LogosSection/logosSection.js b/src/components/LogosSection/logosSection.js index bb436bc..a9d9b6d 100644 --- a/src/components/LogosSection/logosSection.js +++ b/src/components/LogosSection/logosSection.js @@ -1,43 +1,24 @@ import "./logosSection.scss" import React from "react" import { useTheme } from "../../context/themeContext" -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import Carousel from "react-multi-carousel" import "react-multi-carousel/lib/styles.css" import PropTypes from "prop-types" -const handleKeyDown = (event, onClick) => { - if (event.key === "Enter" || event.key === " ") { - onClick() - } -} - const CustomLeftArrow = ({ onClick }) => { return ( - handleKeyDown(event, onClick)} className="react-multiple-carousel__arrow react-multiple-carousel__arrow--left custom-arrow left" - icon="fa-solid fa-chevron-left" onClick={() => onClick()} /> ) } const CustomRightArrow = ({ onClick }) => { return ( - handleKeyDown(event, onClick)} className="react-multiple-carousel__arrow react-multiple-carousel__arrow--right custom-arrow right" - icon="fa-solid fa-chevron-right" onClick={() => onClick()} /> ) diff --git a/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js b/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js index 0e3f868..1fc67c4 100644 --- a/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js +++ b/src/components/NavBar/AnimatedNavBar/DropdownContainer/Dropdown.js @@ -1,138 +1,94 @@ -import { Link } from "gatsby" -import React from "react" -import "./dropdown.scss" -import { GatsbyImage, getImage } from "gatsby-plugin-image" -import { useLandingUrl } from "../../../../hooks" +import React, { memo } from "react" +import CustomImage from "../../../CustomImage/CustomImage" +import CustomLink from "../../../CustomLink/CustomLink" import PropTypes from "prop-types" +import "./dropdown.scss" -const Dropdown = ({ sections, topLevel }) => { - - const getUrl = useLandingUrl() - - const url = (item) => { - const landing = getUrl(item?.english_landing_page?.slug); - - if (landing) return landing; +const RenderSection = ({ section, className }) => { + return ( + <> +
+ + +
+ {section?.text &&

{section.text}

} + + ) +} - return item?.url ? item.url : ''; - } +RenderSection.propTypes = { + className: PropTypes.string, + section: PropTypes.shape({ + label: PropTypes.string.isRequired, + text: PropTypes.string, + url: PropTypes.string, + english_landing_page: PropTypes.shape({ + slug: PropTypes.string.isRequired, + }), + icon: PropTypes.shape({ + url: PropTypes.string, + alternativeText: PropTypes.string, + localFile: PropTypes.shape({ + childImageSharp: PropTypes.shape({ + gatsbyImageData: PropTypes.object.isRequired, + }), + }), + }), + }), +} +const Dropdown = memo(({ sections, topLevel }) => { return (
{topLevel && ( -
-
- {topLevel.icon && ( - - )} - {url(topLevel).startsWith("http") ? ( - - {topLevel.label} - - ) : ( - - {topLevel.label} - - )} -
- {topLevel?.text &&

{topLevel.text}

} +
+
)}
- {sections?.map(section => + {sections?.map(section => (
-
- {section.icon && ( - - )} - {url(section).startsWith("http") ? ( - - {section.label} - - ) : ( - - {section.label} - - )} -
- {section?.text &&

{section.text}

} +
- )} + ))}
-
+
) -} +}) Dropdown.propTypes = { - topLevel: PropTypes.shape({ - text: PropTypes.string, - label: PropTypes.string.isRequired, - url: PropTypes.string, - icon: PropTypes.shape({ - alternativeText: PropTypes.string, - localFile: PropTypes.shape({ - childrenImageSharp: PropTypes.arrayOf( - PropTypes.shape({ - gatsbyImageData: PropTypes.object.isRequired - }) - ) - }) - }) - }), + topLevel: PropTypes.object, sections: PropTypes.arrayOf( PropTypes.shape({ - id: PropTypes.number, - text: PropTypes.string, - label: PropTypes.string, - icon: PropTypes.shape({ - alternativeText: PropTypes.string, - localFile: PropTypes.shape({ - childrenImageSharp: PropTypes.arrayOf( - PropTypes.shape({ - gatsbyImageData: PropTypes.object.isRequired - }) - ) - }) - }) + id: PropTypes.number.isRequired, }) - ) + ), } export default Dropdown diff --git a/src/components/NavBar/AnimatedNavBar/DropdownContainer/dropdown.scss b/src/components/NavBar/AnimatedNavBar/DropdownContainer/dropdown.scss index 70ae4e8..6188e15 100644 --- a/src/components/NavBar/AnimatedNavBar/DropdownContainer/dropdown.scss +++ b/src/components/NavBar/AnimatedNavBar/DropdownContainer/dropdown.scss @@ -58,8 +58,10 @@ } .navbarItemIcon { - width: 28px !important; - height: 28px !important; + width: 100%; + height: 100%; + max-width: 28px; + max-height: 28px; align-self: center; margin-right: 5px; diff --git a/src/components/NavBar/AnimatedNavBar/DropdownContainer/index.js b/src/components/NavBar/AnimatedNavBar/DropdownContainer/index.js index 93d4e92..78d1ae3 100644 --- a/src/components/NavBar/AnimatedNavBar/DropdownContainer/index.js +++ b/src/components/NavBar/AnimatedNavBar/DropdownContainer/index.js @@ -4,10 +4,7 @@ import { Flipped } from "react-flip-toolkit" import FadeContents from "./FadeContents" const getFirstDropdownSectionHeight = el => { - if ( - !el?.querySelector("*[data-first-dropdown-section]") - ) - return 0 + if (!el?.querySelector("*[data-first-dropdown-section]")) return 0 return el.querySelector("*[data-first-dropdown-section]").offsetHeight } @@ -84,7 +81,6 @@ class DropdownContainer extends Component {
(this.altBackgroundEl = el)} - duration={duration} /> { const { theme, toggleTheme } = useTheme() const navbarData = useNavbar() - const getUrl = useLandingUrl() const menuData = navbarData.allStrapiLayout?.nodes[0].Menu @@ -29,7 +28,7 @@ const NavBar = memo(() => { const navbarButton = navbarData.allStrapiLayout?.nodes[0].navbar?.navButton return ( - + {logoLight && ( { aria-controls="basic-navbar-nav" /> - {/* Menu Links */} {menuData && (
- +
)}
{navbarButton && ( - + )}