Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherange committed Mar 21, 2024
1 parent f0cdc5f commit 289839d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 38 deletions.
3 changes: 1 addition & 2 deletions micro-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"@apollosproject/web-shared": "link:../packages/web-shared",
"@babel/preset-react": "^7.22.5",
"@craco/craco": "^7.0.0",
"@phosphor-icons/react": "^2.0.15",
"@segment/analytics-next": "^1.62.0",
"@sentry/react": "^7.40.0",
"@styled-system/theme-get": "^5.1.2",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@phosphor-icons/react": "2.0.15",
"algoliasearch": "^4.17.0",
"amplitude-js": "^8.21.9",
"apollo-upload-client": "^17.0.0",
Expand All @@ -36,7 +36,6 @@
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^2.0.4",
"react-image-crop": "^10.0.11",
"react-instantsearch-dom": "^6.40.0",
"react-instantsearch-hooks-web": "^6.44.0",
Expand Down
56 changes: 32 additions & 24 deletions micro-service/public/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link id="favicon" rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web embed created using The Apollos Project" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--

<head>
<meta charset="utf-8" />
<link id="favicon" rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web embed created using The Apollos Project" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -21,18 +22,24 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Apollos Web Embeds</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="https://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="https://ia.media-imdb.com/images/rock.jpg" />
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

<div id="root"></div>
<!--
<title>Apollos Web Embeds</title>
<meta property="og:title" content="Mark | Day 2" data-react-helmet="true">
<meta property="og:description" content="Read Mark 1:29-45 and learn about the miracles Jesus performed and the response to them." data-react-helmet="true">
<meta property="og:url" content="https://cedar-creek.apollos.church/?id=UniversalContentItem-49e5a6c2-a006-411a-874b-e39785961896" data-react-helmet="true">
<meta property="og:image" content="https://res.cloudinary.com/hwwbvfvlv/image/fetch/c_limit,f_auto,q_auto,w_750/https://rock.cedarcreek.tv/GetImage.ashx%3Fguid%3D765da8c8-9e54-46d3-8946-0a120e45368f" data-react-helmet="true">

<meta name="twitter:card" content="summary_large_image" data-react-helmet="true">
<meta name="twitter:title" content="Mark | Day 2" data-react-helmet="true">
<meta name="twitter:description" content="Read Mark 1:29-45 and learn about the miracles Jesus performed and the response to them." data-react-helmet="true">
<meta name="twitter:image" content="https://res.cloudinary.com/hwwbvfvlv/image/fetch/c_limit,f_auto,q_auto,w_750/https://rock.cedarcreek.tv/GetImage.ashx%3Fguid%3D765da8c8-9e54-46d3-8946-0a120e45368f" data-react-helmet="true">
<meta name="twitter:image:alt" content="Mark | Day 2" data-react-helmet="true">
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -42,5 +49,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>

</html>
24 changes: 12 additions & 12 deletions micro-service/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Styled from './App.styles';

import ErrorPage from './error-page';
import { parseSlugToIdAndType } from '@apollosproject/web-shared/utils';
import { Helmet, HelmetProvider } from 'react-helmet-async';

Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
Expand All @@ -31,6 +30,14 @@ function ChurchLogo(props) {

function App(props) {
let subdomain = 'cedar_creek';
// let subdomain =
// process.env.NODE_ENV === 'production'
// ? window.location.hostname.split('.').slice(0, -2).join('.')
// : window.location.hostname.split('.').slice(0, -1).join('.');

// if (process.env.NODE_ENV !== 'production' && !subdomain) {
// subdomain = 'apollos-demo';
// }
const churchSlug = subdomain.replace(/-/g, '_');
const searchParams = new URLSearchParams(window.location.search);
const _root = searchParams.get('root');
Expand All @@ -52,17 +59,10 @@ function App(props) {
// Widgets require a church slug to get the correct data
if (churchSlug) {
return (
<HelmetProvider>
<AppProvider church={churchSlug} modal="true">
<Helmet>
<title>Test title</title>
<meta property="og:title" content={'My Title'} />
<meta property="og:description" content={'My Title summary'} />
</Helmet>
<ChurchLogo display="flex" alignItems="center" justifyContent="center" marginTop="40px" />
<RouterProvider router={router} />
</AppProvider>
</HelmetProvider>
<AppProvider church={churchSlug} modal="true">
<ChurchLogo display="flex" alignItems="center" justifyContent="center" marginTop="40px" />
<RouterProvider router={router} />
</AppProvider>
);
}

Expand Down

0 comments on commit 289839d

Please sign in to comment.