File tree Expand file tree Collapse file tree 6 files changed +15
-16
lines changed Expand file tree Collapse file tree 6 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,13 @@ import { Tooltip } from "components/Tooltip";
99import { Input , InputGroup } from "components/Input" ;
1010import { useTokenConversion } from "hooks/useTokenConversion" ;
1111import {
12- formatUnitsWithMaxFractions ,
12+ QUERIESV2 ,
1313 formatUSD ,
14+ formatUnitsWithMaxFractions ,
1415 getToken ,
1516 isNumberEthersParseable ,
1617 parseUnits ,
17- QUERIESV2 ,
1818} from "utils" ;
19- import { useFeatureFlag } from "../../hooks" ;
2019
2120export type Props = {
2221 balance ?: BigNumber ;
@@ -51,8 +50,6 @@ export function AmountInput({
5150} : Props ) {
5251 const token = getToken ( inputTokenSymbol ) ;
5352
54- const hasDemoFlag = useFeatureFlag ( "demo-flag" ) ;
55-
5653 const validationLevel =
5754 ( amountInput ?? "" ) === ""
5855 ? "valid"
@@ -96,7 +93,7 @@ export function AmountInput({
9693 < Input
9794 type = "number"
9895 validationLevel = { validationLevel }
99- placeholder = { hasDemoFlag ? "WORKS!" : " Enter amount. NOT" }
96+ placeholder = " Enter amount"
10097 value = { amountInput }
10198 onWheel = { ( e ) => e . currentTarget . blur ( ) }
10299 onChange = { ( e ) => {
Original file line number Diff line number Diff line change 11import styled from "@emotion/styled" ;
22import Footer from "components/Footer" ;
33import { QUERIESV2 } from "utils" ;
4+ import { useFeatureFlag } from "../../hooks" ;
45
56type LayoutProp = {
67 maxWidth ?: number ;
@@ -13,21 +14,22 @@ const LayoutV2 = ({
1314 children,
1415 transparentBackground,
1516} : LayoutProp ) => {
17+ const hasDemoFlag = useFeatureFlag ( "demo-flag" ) ;
1618 return (
17- < Wrapper transparentBackground = { transparentBackground } >
19+ < Wrapper transparentBackground = { transparentBackground } demo = { hasDemoFlag } >
1820 < InnerWrapper maxWidth = { maxWidth ?? 600 } > { children } </ InnerWrapper >
1921 < Footer />
2022 </ Wrapper >
2123 ) ;
2224} ;
2325
24- const Wrapper = styled . div < { transparentBackground ?: boolean } > `
26+ const Wrapper = styled . div < { transparentBackground ?: boolean ; demo : boolean } > `
2527 display: flex;
2628 flex-direction: column;
2729 justify-content: space-between;
2830
29- background-color: ${ ( { transparentBackground } ) =>
30- transparentBackground ? "transparent" : "#2d2e33" } ;
31+ background-color: ${ ( { transparentBackground, demo } ) =>
32+ demo ? "#bada55" : transparentBackground ? "transparent" : "#2d2e33" } ;
3133
3234 /* Subtract to account for header */
3335 min-height: calc(100vh - 72px);
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export function FeatureFlagsProvider({ children }: { children: ReactNode }) {
2424 publicDeploymentKey ,
2525 { }
2626 ) ;
27- // set flags from localstorage before a fetch is initialized
27+ // set flags from localstorage cache before a fetch is initialized
2828 setFlags ( experimentClientRef . current . all ( ) ) ;
2929 setIsInitialized ( true ) ;
3030 } , [ ] ) ;
Original file line number Diff line number Diff line change 11import { useContext } from "react" ;
22import { FeatureFlagsContext } from "./featureFlagsContext" ;
33
4- export const useFeatureFlags = ( ) => {
4+ export const useFeatureFlagsContext = ( ) => {
55 const context = useContext ( FeatureFlagsContext ) ;
66 if ( ! context ) {
77 throw new Error ( "useFeatureFlags must be used within FeatureFlagsProvider" ) ;
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ import {
88 setUserId ,
99} from "utils/amplitude" ;
1010import { ampli } from "ampli" ;
11- import { useFeatureFlags } from "./feature-flags/useFeatureFlags " ;
11+ import { useFeatureFlagsContext } from "./feature-flags/useFeatureFlagsContext " ;
1212
1313export function useInitialUserPropTraces ( isAmpliLoaded : boolean ) {
14- const { fetchFlags } = useFeatureFlags ( ) ;
14+ const { fetchFlags } = useFeatureFlagsContext ( ) ;
1515 const [ areInitialUserPropsSet , setAreInitialUserPropsSet ] = useState ( false ) ;
1616 const [ prevTrackedAccount , setPrevTrackedAccount ] = useState <
1717 string | undefined
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ import {
88 isAmplitudeLoggingEnabled ,
99 isProductionBuild ,
1010} from "utils" ;
11- import { useFeatureFlags } from "./feature-flags/useFeatureFlags " ;
11+ import { useFeatureFlagsContext } from "./feature-flags/useFeatureFlagsContext " ;
1212
1313export function useLoadAmpli ( ) {
1414 const [ isAmpliLoaded , setIsAmpliLoaded ] = useState ( false ) ;
15- const { initializeFeatureFlags } = useFeatureFlags ( ) ;
15+ const { initializeFeatureFlags } = useFeatureFlagsContext ( ) ;
1616
1717 useEffect ( ( ) => {
1818 if ( amplitudeAPIKey && ! isAmpliLoaded ) {
You can’t perform that action at this time.
0 commit comments