Skip to content

Commit

Permalink
minor incremental cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavinok committed Jul 28, 2023
1 parent 8d80601 commit dbfc3bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 0 additions & 4 deletions backend/app/Db.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ import Database.SQLite.Simple (
close,
execute,
execute_,
field,
fromRow,
open,
query,
query_,
toRow,
)
import Database.SQLite.Simple.ToField (ToField (toField))
import GHC.Generics (Generic)
import Restaurant
import qualified User as U
Expand Down Expand Up @@ -158,7 +155,6 @@ likedResturants s = do
]
)
[s]
print "resturant"
c <- dbClose conn
pure (c, r)

Expand Down
17 changes: 10 additions & 7 deletions frontend/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ module Main
where

import Prelude

import Data.Array (cons, last)
import Data.Either (Either(..))
import Data.Maybe (Maybe(..))
import Data.String (split, Pattern(..))
import Effect (Effect)
import Effect.Aff (Error, makeAff, Aff)
import Effect.Aff.Class (class MonadAff, liftAff)
Expand All @@ -27,14 +29,13 @@ import Effect.Console (log)
import Fetch (Method(..), fetch)
import Flame (QuerySelector(..), Html, (:>), ListUpdate)
import Flame as F
import Flame.Subscription.Window as FSW
import Flame.Html.Attribute as HA
import Flame.Html.Element as HE
import Yoga.JSON as JSON
import Flame.Subscription.Window as FSW
import Web.HTML (window)
import Web.HTML.Window (location)
import Web.HTML.Location (href)
import Data.String (split, Pattern(..))
import Web.HTML.Window (location, sessionStorage)
import Yoga.JSON as JSON

foreign import _geolocation
:: forall a
Expand Down Expand Up @@ -71,6 +72,10 @@ geolocation =
$ makeAff \cb ->
_geolocation Right Left cb $> mempty

-- TODO replace localhost url with our real url
sessionUrl String String
sessionUrl session = "http://localhost:1234/" <> session

type ErrorMessage = String

-- | This datatype is used to signal events to `update`
Expand Down Expand Up @@ -301,7 +306,6 @@ grey = (Just "bg-gray-900 hover:bg-gray-800")
footer content = HE.div [ HA.class' "fill flex items-center justify-between mb-3lcontainer mx-auto rounded" ]
content

-- TODO Implement QR Code prompt
-- | `view` updates the app markup whenever the model is updated
view :: Model -> Html Message
view (ServerError e) = HE.main "main" [ HE.text $ "Error: " <> e ]
Expand All @@ -316,8 +320,7 @@ view (QR session) =
HE.main "main"
[ HE.div [ HA.class' "flex flex-col items-center justify-center " ]
[ HE.div [ HA.class' "purple fill" ] [HE.a [ HA.href session, HA.value "Join Session"] "Join Session"]
-- TODO replace localhost url with our real url
, HE.img [ HA.src $ "https://api.qrserver.com/v1/create-qr-code/?data="<> "http://localhost:1234/" <> session
, HE.img [ HA.src $ "https://api.qrserver.com/v1/create-qr-code/?data="<> sessionUrl session
, HA.alt ""]
, HE.div_
[ btn (StartSwiping) "Start Swiping" grey
Expand Down

0 comments on commit dbfc3bf

Please sign in to comment.