@2dine/promos 中文文档教程
promos
用于促销、优惠券、广告和广告的 2dine 模块 新闻
Install
yarn add @2dine/promos
Usage
import React from 'react'
import {
BrowserRouter as Router,
Switch,
Route,
useHistory
} from 'react-router-dom'
import { Slider, PromoProvider } from 'promos'
import awsConfig from './aws-exports'
const Home = () => {
const history = useHistory()
return <Slider restaurantID={'restaurantID'} history={history} />
}
const App = () => {
return (
<Router>
<PromoProvider
awsConfig={awsConfig}
options={{
cdn: 'https://xxxxxxxxxxxx.cloudfront.net'
}}
>
<Switch>
<Route path='/'>
<Home />
</Route>
</Switch>
</PromoProvider>
</Router>
)
}
export default App
License
麻省理工学院 © 2dine
promos
2dine module for promos, coupons, ads & news
Install
yarn add @2dine/promos
Usage
import React from 'react'
import {
BrowserRouter as Router,
Switch,
Route,
useHistory
} from 'react-router-dom'
import { Slider, PromoProvider } from 'promos'
import awsConfig from './aws-exports'
const Home = () => {
const history = useHistory()
return <Slider restaurantID={'restaurantID'} history={history} />
}
const App = () => {
return (
<Router>
<PromoProvider
awsConfig={awsConfig}
options={{
cdn: 'https://xxxxxxxxxxxx.cloudfront.net'
}}
>
<Switch>
<Route path='/'>
<Home />
</Route>
</Switch>
</PromoProvider>
</Router>
)
}
export default App
License
MIT © 2dine