-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#520166 added bootstrap css and Layout component for SXA side (#972)
* #520166 added bootstrap css and Layout component for SXA side * #520166 update yarn.lock * #520166 removed wrong css
- Loading branch information
1 parent
a919354
commit 4d03320
Showing
5 changed files
with
64 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/create-sitecore-jss/src/templates/nextjs-sxa/src/Layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* This Layout needs for SXA example. | ||
*/ | ||
import React from 'react'; | ||
import Head from 'next/head'; | ||
import { | ||
Placeholder, | ||
VisitorIdentification, | ||
getPublicUrl, | ||
LayoutServiceData, | ||
} from '@sitecore-jss/sitecore-jss-nextjs'; | ||
import Navigation from 'src/Navigation'; | ||
|
||
// Prefix public assets with a public URL to enable compatibility with Sitecore Experience Editor. | ||
// If you're not supporting the Experience Editor, you can remove this. | ||
const publicUrl = getPublicUrl(); | ||
|
||
interface LayoutProps { | ||
layoutData: LayoutServiceData; | ||
} | ||
|
||
const Layout = ({ layoutData }: LayoutProps): JSX.Element => { | ||
const { route } = layoutData.sitecore; | ||
|
||
return ( | ||
<> | ||
<Head> | ||
<title>{route?.fields?.pageTitle?.value || 'Page'}</title> | ||
<link rel="icon" href={`${publicUrl}/favicon.ico`} /> | ||
</Head> | ||
|
||
{/* | ||
VisitorIdentification is necessary for Sitecore Analytics to determine if the visitor is a robot. | ||
If Sitecore XP (with xConnect/xDB) is used, this is required or else analytics will not be collected for the JSS app. | ||
For XM (CMS-only) apps, this should be removed. | ||
VI detection only runs once for a given analytics ID, so this is not a recurring operation once cookies are established. | ||
*/} | ||
<VisitorIdentification /> | ||
|
||
<Navigation /> | ||
{/* root placeholder for the app, which we add components to using route data */} | ||
<div className="container"> | ||
<div className="row"> | ||
{route && <Placeholder name="<%- helper.getAppPrefix(appPrefix, appName) %>jss-main" rendering={route} />} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Layout; |
63 changes: 0 additions & 63 deletions
63
packages/create-sitecore-jss/src/templates/nextjs-sxa/src/assets/sxa-styles.css
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/create-sitecore-jss/src/templates/nextjs-sxa/src/pages/_app.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters