2ba352da39
* Initial move * Make emitting work * Update paths * Remove leftover files * Add correct externals configuration * Import correct path * Update path to work with ts-server test * Update lib directory * Compile next-server/lib
15 lines
367 B
TypeScript
15 lines
367 B
TypeScript
import React from 'react'
|
|
import { AmpStateContext } from './amp-context'
|
|
|
|
export function isInAmpMode({
|
|
ampFirst = false,
|
|
hybrid = false,
|
|
hasQuery = false,
|
|
} = {}) {
|
|
return ampFirst || (hybrid && hasQuery)
|
|
}
|
|
|
|
export function useAmp() {
|
|
// Don't assign the context value to a variable to save bytes
|
|
return isInAmpMode(React.useContext(AmpStateContext))
|
|
}
|