mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-13 17:44:19 +02:00
Add title
This commit is contained in:
@@ -3,8 +3,11 @@ import { Link } from 'react-router-dom';
|
|||||||
|
|
||||||
import CenterCover from './covers/CenterCover';
|
import CenterCover from './covers/CenterCover';
|
||||||
import Layout from './Layout';
|
import Layout from './Layout';
|
||||||
|
import useDocumentTitle from './useDocumentTitle';
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
|
useDocumentTitle('CSS Layout');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<h2 className="f2 lh-copy">Pattern</h2>
|
<h2 className="f2 lh-copy">Pattern</h2>
|
||||||
|
@@ -3,8 +3,11 @@ import React from 'react';
|
|||||||
import DetailsLayout from '../DetailsLayout';
|
import DetailsLayout from '../DetailsLayout';
|
||||||
import BrowserFrame from '../placeholders/BrowserFrame';
|
import BrowserFrame from '../placeholders/BrowserFrame';
|
||||||
import SampleCode from '../SampleCode';
|
import SampleCode from '../SampleCode';
|
||||||
|
import useDocumentTitle from '../useDocumentTitle';
|
||||||
|
|
||||||
const Centering = () => {
|
const Centering = () => {
|
||||||
|
useDocumentTitle('CSS Layout ∙ Centering');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DetailsLayout name="Centering">
|
<DetailsLayout name="Centering">
|
||||||
<BrowserFrame
|
<BrowserFrame
|
||||||
|
9
client/useDocumentTitle.js
Normal file
9
client/useDocumentTitle.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
const useDocumentTitle = (title) => {
|
||||||
|
useEffect(() => {
|
||||||
|
document.title = title;
|
||||||
|
}, [title]);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useDocumentTitle;
|
Reference in New Issue
Block a user