#pragma once // Spec: INV-posts 6.2 (QuoteComposer environment), 3.2 (NavigationLink to ProfileView), 3.1 and 5.2 (single and // double tap gestures of a card or comment). Values SwiftUI passes down the environment; here an explicit struct // handed to every post and comment view. #include #include #include "screens/components/QuoteComposer.hpp" namespace dp { struct TapHandlers { std::function single; // empty = ignore std::function doubleTap; // empty = ignore; when set, a single tap waits PostsTiming::kDoubleTapMs bool any() const { return static_cast(single) || static_cast(doubleTap); } }; struct PostEnvironment { std::function openProfile; // push ProfileView(username) QuoteComposer quote; TapHandlers taps; // gestures of the enclosing card or comment, forwarded by text that owns a long press }; } // namespace dp