Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode
dom-html.txt
.scannerwork
**/.DS_Store

Binary file added uli-website/.DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions uli-website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions uli-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"deploy": "gatsby-plugin-s3 deploy --yes"
},
"dependencies": {
"@chenglou/pretext": "^0.0.4",
"@mdx-js/react": "3.0.0",
"babel-plugin-styled-components": "2.1.4",
"gatsby": "5.12.9",
Expand Down
12 changes: 12 additions & 0 deletions uli-website/src/components/atoms/DashedButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";

export default function DashedButton({content, onClick, className=""}) {
return (
<button
className={`font-labrada bg-transparent cursor-pointer border-[0.5px] border-solid [border-image-source:url('/dashed-btn-bg.png')] [border-image-slice:0%_fill] [border-image-repeat:round] hover:bg-[#FFC8A6] active:bg-[#F28948] ${className}`}
onClick={onClick}
>
{content}
</button>
);
}
21 changes: 21 additions & 0 deletions uli-website/src/components/atoms/NavLinkNew.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Link } from 'gatsby';
import { Text } from 'grommet'
import styled from "styled-components";
import React from 'react'

// // Navlink component for the new design
// export default function NavLink({children, className=""}) {
// return (
// <Text className={`cursor-pointer hover:text-[#F28948] hover:underline #{className}`}>{children}</Text>

// )
// }

export const NavLinkNew = styled(Link)`
text-decoration: none;
color: inherit;
&:hover {
color: #F28948;
text-decoration: underline;
}
`;
23 changes: 0 additions & 23 deletions uli-website/src/components/molecules/AnnouncementBanner.jsx

This file was deleted.

44 changes: 44 additions & 0 deletions uli-website/src/components/molecules/Announcements.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Box, Text } from "grommet";
import React, { useState, useEffect, useContext } from "react";
import DashedButton from "../atoms/DashedButton";
import { navigate } from "gatsby";

function AnnouncementBanner({ children }) {
return (
<Box
align="center"
className="
w-fit
mx-auto
text-center
border-solid
border-[1.2em]
px-2
[border-image-source:url('/announcement-bg.svg')]
[border-image-slice:33%_4%_fill]
[border-image-repeat:round]>
animate-[fadeUp_1.2s_ease-out_forwards]
"
>
{children}
</Box>
);
}

export default function Announcements() {
return (
<AnnouncementBanner>
<Box className="flex flex-col gap-2 items-center">
<Text className="text-[0.8em] font-bold font-labrada">Uli joins UNICEF FemTech Cohort</Text>
<Text className="text-[0.8em] font-labrada leading-[140%]">
Our solution that monitors users’ social media feeds, identifies abuse and connects users to support networks has got selected to be developed further by the UNICEF FemTech Ventures.
</Text>
<DashedButton
className="mt-1 w-fit px-10 py-2"
content={<Text className="text-[13px] font-labrada tracking-[-0.05em]">Read the announcement</Text>}
onClick={() => navigate("https://www.unicef.org/innovation/femtech-cohort-1")}
/>
</Box>
</AnnouncementBanner>
);
}
67 changes: 67 additions & 0 deletions uli-website/src/components/molecules/AppShellNew.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { Grommet, Box } from "grommet";
import * as React from "react";
import { Helmet } from "react-helmet";
import { Colors, NavLink, Theme } from "../atoms/UliCore";
import NavBarNew from "./NavBarNew";
import i18n from "../atoms/i18n";
import { useTranslation } from "react-i18next";
import { useLocation } from "@reach/router";
import FooterNew from "./FooterNew";

export default function AppShellNew({ children }) {
const { t, i18n } = useTranslation();
React.useEffect(() => {
const lang = localStorage.getItem("uli-lang");
i18n.changeLanguage(lang);
}, []);
const location = useLocation();

let fullPath = location.pathname;
if (fullPath.slice(-1) === "/") {
fullPath = fullPath.slice(0, -1);
}
let title = fullPath.split("/").at(-1);

if (["hi", "en", "ta", "ma"].includes(title)) {
title = "Uli";
}

title = formatTitle(title);
Comment on lines +19 to +29
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

The homepage og:title resolves to an empty string.

For /, Lines 19-23 normalize the path to "", so title stays empty and Line 51 emits a blank Open Graph title on the homepage. Please default the root/empty case to "Uli" before formatting.

Also applies to: 51-51

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@uli-website/src/components/molecules/AppShellNew.jsx` around lines 19 - 29,
The homepage OG title is empty because location.pathname "/" gets normalized to
an empty string and then passed to formatTitle; update the logic around
fullPath/title so that after trimming the trailing "/" and deriving title
(variables fullPath and title) you check if title is falsy (empty string) or
matches the locale list and set title = "Uli" before calling formatTitle; ensure
the same change covers the branch that currently checks ["hi","en","ta","ma"]
and that the final title used for the og:title (where formatTitle is applied)
will never be empty.


function formatTitle(str) {
return str
.split("-")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ");
}
return (
<Grommet theme={Theme}>
<main
style={{
display: "flex",
flexDirection: "column",
minHeight: "100vh",
}}
>
<Helmet>
<meta charSet="utf-8" />
<title>Uli</title>
<link rel="stylesheet" href="/layout.css" />
<link rel="stylesheet" href="https://use.typekit.net/twt1ywc.css" />
<meta property="og:title" content={title} />
<meta name="icon" href="images/favicon-32x32.png" />

<script
defer
data-domain="uli.tattle.co.in"
src="https://plausible.io/js/plausible.js"
></script>
</Helmet>

<NavBarNew />
<Box flex="grow" className="font-labrada">{children}</Box>
<FooterNew />
</main>
</Grommet>
);
}
Loading
Loading