-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "Revert "UI groundwork: Conversions to Behaviors (#3005)" (#3024)" This reverts commit dc0853b. * Move ref back to LazyLoader container
- Loading branch information
Showing
20 changed files
with
631 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from "react" | ||
import { sectionTitles } from "../stats/behaviours" | ||
import * as api from '../api' | ||
|
||
export function FeatureSetupNotice({ site, feature, shortFeatureName, title, info, settingsLink, onHideAction }) { | ||
const sectionTitle = sectionTitles[feature] | ||
|
||
const requestHideSection = () => { | ||
if (window.confirm(`Are you sure you want to hide ${sectionTitle}? You can make it visible again in your site settings later.`)) { | ||
api.put(`/api/${encodeURIComponent(site.domain)}/disable-feature`, { feature: feature }) | ||
.then(response => { | ||
if (response.ok) { onHideAction() } | ||
}) | ||
} | ||
} | ||
|
||
function setupButton() { | ||
return ( | ||
<a href={settingsLink} className="ml-2 sm:ml-4 button px-2 sm:px-4"> | ||
<p className="flex flex-col justify-center text-xs sm:text-sm">Set up {shortFeatureName}</p> | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="ml-2 w-5 h-5"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75" /> | ||
</svg> | ||
</a> | ||
) | ||
} | ||
|
||
function hideButton() { | ||
return ( | ||
<button | ||
onClick={requestHideSection} | ||
className="inline-block px-2 sm:px-4 py-2 border border-gray-300 dark:border-gray-500 leading-5 rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition ease-in-out duration-150"> | ||
Hide this report | ||
</button> | ||
) | ||
} | ||
|
||
return ( | ||
<div className="sm:mx-32 mt-6 mb-3" > | ||
<div className="py-3"> | ||
<div className="text-center mt-2 text-gray-800 dark:text-gray-200"> | ||
{title} | ||
</div> | ||
|
||
<div className="text-justify mt-4 font-small text-sm text-gray-500 dark:text-gray-200"> | ||
{info} | ||
</div> | ||
|
||
<div className="text-xs sm:text-sm flex my-6 justify-center"> | ||
{hideButton()} | ||
{setupButton()} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default function Funnel(_props) { | ||
// TODO | ||
return null | ||
} |
Oops, something went wrong.