-
-### Sponsor
-
-|||
-|-|-|
-||If you want to quickly add secure (JSON Web) token-based authentication to your projects, feel free to check Auth0's documentation and free plan at [developer.auth0.com](https://developer.auth0.com)|
-
-### How to add a library
-
-To add a library, simply edit the right JSON file located at `views/website/libraries`. Each language gets its own file. Multiple libraries share the same language file.
-
-To add a new language, simply add a JSON file in the same folder as the others. It will get automatically recognized. If you add a new language, you will need to provide a proper icon for it and place it in the `img` folder.
-
-Here's a commented example of the .NET language file (`0-.NET.json`). All fields must have valid values unless noted:
-
-```javascript
-{
- // Language name (unique)
- "name": ".NET",
-
- // Unique identifier that will be used as a CSS class
- // for this language (only valid CSS class names).
- "uniqueClass": "net",
-
- // The language icon, SVG format preferred, should be placed
- // in /img directory.
- "image": "/img/1.svg",
-
- // The color of header that displays the name of the language
- // and the icon. This is a valid CSS color definition.
- "bgColor": "rgb(42, 168, 229)",
-
- // An array of libraries for this language.
- "libs": [
- {
- // In case the library suffered from a vulnerability, the
- // minimum version in which the vuln was fixed must be
- // listed here. Optional (can be null).
- "minimumVersion": "1.0.1", // or null
-
- // Supported features, true for supported,
- // false for not supported.
- "support": {
- "sign": true,
- "verify": true,
- "iss": true,
- "sub": true,
- "aud": true,
- "exp": true,
- "nbf": true,
- "iat": true,
- "jti": true,
- "hs256": true,
- "hs384": true,
- "hs512": true,
- "rs256": true,
- "rs384": true,
- "rs512": true,
- "es256": true,
- "es384": true,
- "es512": true,
- "ps256": true,
- "ps384": true,
- "ps512": true,
- "eddsa": true
- },
-
- // Author URL, can be GitHub profile, personal page
- // company page, etc. Can be null.
- "authorUrl": "https://www.microsoft.com", // or null
-
- // Author name.
- "authorName": "Microsoft",
-
- // For the star count, this is the GitHub repository path,
- // (usually user/repo). Can be null (no star count shown).
- "gitHubRepoPath": "AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet", // or null
-
- // URL for source code.
- "repoUrl": "https://github.com/MSOpenTech/azure-activedirectory-identitymodel-extensions-for-dotnet",
-
- // Install command, can be HTML or plain text.
- "installCommandHtml": "Install-Package{dictionary.description}
+
+ );
+ },
+ a: ({ node, ...props }) => {
+ return (
+
+ );
+ },
+ }}
+ >
+ {children}
+ + {sectionHeadline.description} +
+ )} + > + )} ++ {dictionary.modal.content} +
++ {modalState === HeroModalStateValues.CLOSED && ( + {modalSummary} + )} + + {modalState === HeroModalStateValues.OPEN && ( + <> + {modalContent} + {modalCta} + > + )} +
+ ); +}; diff --git a/src/features/common/components/hero/hero-info-banner.component.tsx b/src/features/common/components/hero/hero-info-banner.component.tsx new file mode 100644 index 00000000..5e806808 --- /dev/null +++ b/src/features/common/components/hero/hero-info-banner.component.tsx @@ -0,0 +1,76 @@ +import React from "react"; +import styles from "./hero-banner-modal.module.scss"; +import { HomeDictionaryModel } from "@/features/localization/models/home-dictionary.model"; +import { HeroModalStateValues } from "@/features/home/values/hero-modal-state.values"; +import { JWT_INFO_STATE_KEY } from "@/features/home/config/home.config"; +import Link from "next/link"; +import { clsx } from "clsx"; +import { createUrlPath } from "@/libs/utils/path.utils"; +import { DEFAULT_LANGUAGE_CODE } from "@/features/localization/localization.config"; +import { HeroBannerComponent } from "@/features/common/components/hero/hero-banner.component"; +import { HeroModalTypeValues } from "@/features/home/values/hero-modal-type.values"; + +interface HeroInfoBannerComponentProps { + languageCode: string; + dictionary: HomeDictionaryModel["info"]; + modalState: HeroModalStateValues; +} + +export const HeroInfoBannerComponent: React.FC< + HeroInfoBannerComponentProps +> = ({ languageCode, dictionary, modalState }) => { + const ctaPath = createUrlPath([ + languageCode === DEFAULT_LANGUAGE_CODE ? "" : languageCode, + dictionary.ctaButton ? dictionary.ctaButton.path : "", + ]); + const secondaryCtaPath = createUrlPath([ + languageCode === DEFAULT_LANGUAGE_CODE ? "" : languageCode, + dictionary.secondaryCtaButton ? dictionary.secondaryCtaButton.path : "", + ]); + + const description = dictionary.description.split( + dictionary.resources.spec.name, + ); + + return ( +{renderTokens(tokens)};
+ })}
+