mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-14 01:54:47 +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 Layout from './Layout';
|
||||
import useDocumentTitle from './useDocumentTitle';
|
||||
|
||||
const Home = () => {
|
||||
useDocumentTitle('CSS Layout');
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<h2 className="f2 lh-copy">Pattern</h2>
|
||||
|
@@ -3,8 +3,11 @@ import React from 'react';
|
||||
import DetailsLayout from '../DetailsLayout';
|
||||
import BrowserFrame from '../placeholders/BrowserFrame';
|
||||
import SampleCode from '../SampleCode';
|
||||
import useDocumentTitle from '../useDocumentTitle';
|
||||
|
||||
const Centering = () => {
|
||||
useDocumentTitle('CSS Layout ∙ Centering');
|
||||
|
||||
return (
|
||||
<DetailsLayout name="Centering">
|
||||
<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