Skip to content

Commit

Permalink
Make images in .package-readme inline-block (#163)
Browse files Browse the repository at this point in the history
* Make images in .package-readme inline-block

Fix #162

* lint

* Add an ignore in .hlint.yaml

* Refactor the effect list for `lockAccount`
  • Loading branch information
tchoutri authored Aug 5, 2022
1 parent 7745225 commit b7ead78
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 19 deletions.
1 change: 1 addition & 0 deletions .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
- ignore: {name: "Avoid lambda"}
- ignore: {name: "Use newtype instead of data"}
- ignore: {name: "Use tuple-section"}
- ignore: {name: "Monad law, left identity"}
4 changes: 0 additions & 4 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ div[class="bullets"] {
.category-card:hover {
@apply bg-gray-7 dark:bg-blue-1;
}
.package-readme-column{
margin: 0 2em;
overflow: auto;
}

ul.package-list a {
@apply py-3 pl-4;
Expand Down
6 changes: 6 additions & 0 deletions assets/css/package-readme.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.package-readme-column{
margin: 0 2em;
overflow: auto;
}

.package-readme{
overflow-wrap: break-word;
box-sizing: border-box;
Expand All @@ -15,6 +20,7 @@
img {
max-width: 100%;
box-sizing: content-box;
display: inline-block;
}

h2 {
Expand Down
3 changes: 2 additions & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"build-css": "NODE_BUILD=prod postcss css/app.css -o ../static/css/app.css",
"copy-static-files": "cpx \"**/*.{svg,png,jpg}\" ../static",
"watch-static-files": "cpx \"**/*.{svg,png,jpg}\" ../static -w"
}
},
"dependencies": {}
}
6 changes: 3 additions & 3 deletions assets/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001286, caniuse-lite@^1.0.30001297:
version "1.0.30001302"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001302.tgz#da57ce61c51177ef3661eeed7faef392d3790aaa"
integrity sha512-YYTMO+tfwvgUN+1ZnRViE53Ma1S/oETg+J2lISsqi/ZTNThj3ZYBOKP2rHwJc37oCsPqAzJ3w2puZHn0xlLPPw==
version "1.0.30001374"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz"
integrity sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==

chalk@^2.0.0, chalk@^2.4.1:
version "2.4.2"
Expand Down
2 changes: 1 addition & 1 deletion src/Flora/Model/Release/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ getPackageReleases =
select r.release_id, r.version, p."name"
from releases as r
join packages as p
on p.package_id = dbtToEff $ r.package_id
on p.package_id = r.package_id
|]

getReleaseByVersion :: [DB, IOE] :>> es => PackageId -> Version -> Eff es (Maybe Release)
Expand Down
4 changes: 2 additions & 2 deletions src/Flora/Model/User/Update.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Database.PostgreSQL.Entity.DBT (QueryNature (Update), execute)
import Database.PostgreSQL.Simple (Only (Only))
import Database.PostgreSQL.Simple.SqlQQ (sql)

import Effectful (Eff, IOE, type (:>), type (:>>))
import Effectful (Eff, IOE, type (:>>))
import Effectful.PostgreSQL.Transact.Effect (DB, dbtToEff)
import Flora.Model.User
import Optics.Core ((^.))
Expand All @@ -20,7 +20,7 @@ addAdmin form = do
unlockAccount (adminUser ^. #userId)
pure adminUser

lockAccount :: (DB :> es, IOE :> es) => UserId -> Eff es ()
lockAccount :: ([DB, IOE] :>> es) => UserId -> Eff es ()
lockAccount userId = dbtToEff $ void $ execute Update q (Only userId)
where
q =
Expand Down
14 changes: 6 additions & 8 deletions src/FloraWeb/Templates.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE CPP #-}

module FloraWeb.Templates
( render
, renderUVerb
Expand All @@ -8,16 +6,17 @@ module FloraWeb.Templates
)
where

import Control.Monad (when)
import Control.Monad.Identity (runIdentity)
import Control.Monad.Reader
import Control.Monad.Reader (runReaderT)
import Data.ByteString.Lazy
import Data.Text (Text)
import Lucid
import Optics.Core

import Data.Text (Text)
import Flora.Environment (DeploymentEnv (..))
import FloraWeb.Components.Header (header)
import FloraWeb.Templates.Types as Types
import Optics.Core

render :: (Monad m) => TemplateEnv -> FloraHTML -> m (Html ())
render env template =
Expand All @@ -38,6 +37,5 @@ rendered :: DeploymentEnv -> FloraHTML -> FloraHTML
rendered deploymentEnv target = do
header
main_ [] target
if deploymentEnv == Development
then script_ [src_ "/static/js/autoreload.js", type_ "module"] ("" :: Text)
else pure ()
when (deploymentEnv == Development) $
script_ [src_ "/static/js/autoreload.js", type_ "module"] ("" :: Text)

0 comments on commit b7ead78

Please sign in to comment.